Ben Murdoch | 3240926 | 2013-08-07 11:04:47 +0100 | [diff] [blame] | 1 | // Copyright 2013 The Chromium Authors. All rights reserved. |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Ben Murdoch | 3240926 | 2013-08-07 11:04:47 +0100 | [diff] [blame] | 5 | #ifndef CHROME_BROWSER_UI_AUTOFILL_MOCK_AUTOFILL_DIALOG_VIEW_DELEGATE_H_ |
| 6 | #define CHROME_BROWSER_UI_AUTOFILL_MOCK_AUTOFILL_DIALOG_VIEW_DELEGATE_H_ |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 7 | |
Ben Murdoch | 3240926 | 2013-08-07 11:04:47 +0100 | [diff] [blame] | 8 | #include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.h" |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 9 | #include "testing/gmock/include/gmock/gmock.h" |
| 10 | |
| 11 | namespace autofill { |
| 12 | |
Ben Murdoch | 3240926 | 2013-08-07 11:04:47 +0100 | [diff] [blame] | 13 | class MockAutofillDialogViewDelegate : public AutofillDialogViewDelegate { |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 14 | public: |
Ben Murdoch | 3240926 | 2013-08-07 11:04:47 +0100 | [diff] [blame] | 15 | MockAutofillDialogViewDelegate(); |
| 16 | virtual ~MockAutofillDialogViewDelegate(); |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 17 | |
Ben Murdoch | ca12bfa | 2013-07-23 11:17:05 +0100 | [diff] [blame] | 18 | MOCK_CONST_METHOD0(DialogTitle, string16()); |
| 19 | MOCK_CONST_METHOD0(AccountChooserText, string16()); |
| 20 | MOCK_CONST_METHOD0(SignInLinkText, string16()); |
| 21 | MOCK_CONST_METHOD0(EditSuggestionText, string16()); |
| 22 | MOCK_CONST_METHOD0(CancelButtonText, string16()); |
| 23 | MOCK_CONST_METHOD0(ConfirmButtonText, string16()); |
| 24 | MOCK_CONST_METHOD0(SaveLocallyText, string16()); |
Ben Murdoch | bb1529c | 2013-08-08 10:24:53 +0100 | [diff] [blame^] | 25 | MOCK_CONST_METHOD0(SaveLocallyTooltip, string16()); |
Ben Murdoch | ca12bfa | 2013-07-23 11:17:05 +0100 | [diff] [blame] | 26 | MOCK_METHOD0(LegalDocumentsText, string16()); |
| 27 | MOCK_CONST_METHOD0(SignedInState, DialogSignedInState()); |
| 28 | MOCK_CONST_METHOD0(ShouldShowSpinner, bool()); |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 29 | MOCK_CONST_METHOD0(ShouldOfferToSaveInChrome, bool()); |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 30 | MOCK_METHOD0(MenuModelForAccountChooser, ui::MenuModel*()); |
Ben Murdoch | ca12bfa | 2013-07-23 11:17:05 +0100 | [diff] [blame] | 31 | MOCK_METHOD0(AccountChooserImage, gfx::Image()); |
| 32 | MOCK_CONST_METHOD0(ShouldShowProgressBar, bool()); |
Ben Murdoch | 2385ea3 | 2013-08-06 11:01:04 +0100 | [diff] [blame] | 33 | MOCK_CONST_METHOD0(ButtonStripImage, gfx::Image()); |
Ben Murdoch | ca12bfa | 2013-07-23 11:17:05 +0100 | [diff] [blame] | 34 | MOCK_CONST_METHOD0(GetDialogButtons, int()); |
| 35 | MOCK_CONST_METHOD0(ShouldShowDetailArea, bool()); |
| 36 | MOCK_CONST_METHOD1(IsDialogButtonEnabled, bool(ui::DialogButton button)); |
| 37 | MOCK_CONST_METHOD0(GetDialogOverlay, DialogOverlayState()); |
| 38 | MOCK_METHOD0(LegalDocumentLinks, const std::vector<ui::Range>&()); |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 39 | MOCK_CONST_METHOD1(SectionIsActive, bool(DialogSection)); |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 40 | MOCK_CONST_METHOD1(RequestedFieldsForSection, |
| 41 | const DetailInputs&(DialogSection)); |
| 42 | MOCK_METHOD1(ComboboxModelForAutofillType, |
Ben Murdoch | 3240926 | 2013-08-07 11:04:47 +0100 | [diff] [blame] | 43 | ui::ComboboxModel*(ServerFieldType)); |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 44 | MOCK_METHOD1(MenuModelForSection, ui::MenuModel*(DialogSection)); |
Ben Murdoch | ca12bfa | 2013-07-23 11:17:05 +0100 | [diff] [blame] | 45 | MOCK_CONST_METHOD1(LabelForSection, string16(DialogSection section)); |
| 46 | MOCK_METHOD1(SuggestionStateForSection, SuggestionState(DialogSection)); |
| 47 | MOCK_METHOD1(EditClickedForSection, void(DialogSection section)); |
| 48 | MOCK_METHOD1(EditCancelledForSection, void(DialogSection section)); |
| 49 | MOCK_CONST_METHOD2(IconForField, |
Ben Murdoch | 3240926 | 2013-08-07 11:04:47 +0100 | [diff] [blame] | 50 | gfx::Image(ServerFieldType, const string16&)); |
Ben Murdoch | ca12bfa | 2013-07-23 11:17:05 +0100 | [diff] [blame] | 51 | MOCK_METHOD3(InputValidityMessage, |
Ben Murdoch | 3240926 | 2013-08-07 11:04:47 +0100 | [diff] [blame] | 52 | string16(DialogSection, ServerFieldType, const string16&)); |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 53 | MOCK_METHOD3(InputsAreValid, ValidityData(DialogSection, |
| 54 | const DetailOutputMap&, |
| 55 | ValidationType)); |
Ben Murdoch | ca12bfa | 2013-07-23 11:17:05 +0100 | [diff] [blame] | 56 | MOCK_METHOD6(UserEditedOrActivatedInput,void(DialogSection, |
| 57 | const DetailInput*, |
| 58 | gfx::NativeView, |
| 59 | const gfx::Rect&, |
| 60 | const string16&, |
| 61 | bool was_edit)); |
| 62 | MOCK_METHOD1(HandleKeyPressEventInInput, |
| 63 | bool(const content::NativeWebKeyboardEvent& event)); |
| 64 | MOCK_METHOD0(FocusMoved, void()); |
| 65 | MOCK_CONST_METHOD0(SplashPageImage, gfx::Image()); |
| 66 | MOCK_METHOD0(ViewClosed, void()); |
| 67 | MOCK_METHOD0(CurrentNotifications,std::vector<DialogNotification>()); |
| 68 | MOCK_CONST_METHOD0(CurrentAutocheckoutSteps, |
| 69 | std::vector<DialogAutocheckoutStep>()); |
| 70 | MOCK_METHOD0(SignInLinkClicked, void()); |
| 71 | MOCK_METHOD2(NotificationCheckboxStateChanged, |
| 72 | void(DialogNotification::Type, bool)); |
| 73 | MOCK_METHOD1(LegalDocumentLinkClicked, void(const ui::Range&)); |
| 74 | MOCK_METHOD0(OverlayButtonPressed, void()); |
| 75 | MOCK_METHOD0(OnCancel, bool()); |
| 76 | MOCK_METHOD0(OnAccept, bool()); |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 77 | MOCK_METHOD0(profile, Profile*()); |
Ben Murdoch | bb1529c | 2013-08-08 10:24:53 +0100 | [diff] [blame^] | 78 | MOCK_METHOD0(GetWebContents, content::WebContents*()); |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 79 | private: |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 80 | DetailInputs default_inputs_; |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 81 | DetailInputs cc_default_inputs_; // Default inputs for SECTION_CC. |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 82 | std::vector<ui::Range> range_; |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 83 | }; |
| 84 | |
| 85 | } // namespace autofill |
| 86 | |
Ben Murdoch | 3240926 | 2013-08-07 11:04:47 +0100 | [diff] [blame] | 87 | #endif // CHROME_BROWSER_UI_AUTOFILL_MOCK_AUTOFILL_DIALOG_VIEW_DELEGATE_H_ |