OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_AUTOFILL_MOCK_AUTOFILL_DIALOG_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_MOCK_AUTOFILL_DIALOG_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_AUTOFILL_MOCK_AUTOFILL_DIALOG_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_MOCK_AUTOFILL_DIALOG_CONTROLLER_H_ |
7 | 7 |
8 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" | 8 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" |
9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
10 | 10 |
11 namespace autofill { | 11 namespace autofill { |
12 | 12 |
13 class MockAutofillDialogController : public AutofillDialogController { | 13 class MockAutofillDialogController : public AutofillDialogController { |
14 public: | 14 public: |
15 MockAutofillDialogController(); | 15 MockAutofillDialogController(); |
16 virtual ~MockAutofillDialogController(); | 16 virtual ~MockAutofillDialogController(); |
17 | 17 |
18 virtual string16 DialogTitle() const OVERRIDE; | 18 MOCK_CONST_METHOD0(DialogTitle, string16()); |
19 virtual string16 AccountChooserText() const OVERRIDE; | 19 MOCK_CONST_METHOD0(AccountChooserText, string16()); |
20 virtual string16 SignInLinkText() const OVERRIDE; | 20 MOCK_CONST_METHOD0(SignInLinkText, string16()); |
21 virtual string16 EditSuggestionText() const OVERRIDE; | 21 MOCK_CONST_METHOD0(EditSuggestionText, string16()); |
22 virtual string16 CancelButtonText() const OVERRIDE; | 22 MOCK_CONST_METHOD0(CancelButtonText, string16()); |
23 virtual string16 ConfirmButtonText() const OVERRIDE; | 23 MOCK_CONST_METHOD0(ConfirmButtonText, string16()); |
24 virtual string16 SaveLocallyText() const OVERRIDE; | 24 MOCK_CONST_METHOD0(SaveLocallyText, string16()); |
25 virtual string16 LegalDocumentsText() OVERRIDE; | 25 MOCK_METHOD0(LegalDocumentsText, string16()); |
26 virtual DialogSignedInState SignedInState() const OVERRIDE; | 26 MOCK_CONST_METHOD0(SignedInState, DialogSignedInState()); |
27 virtual bool ShouldShowSpinner() const OVERRIDE; | 27 MOCK_CONST_METHOD0(ShouldShowSpinner, bool()); |
28 MOCK_CONST_METHOD0(ShouldOfferToSaveInChrome, bool()); | 28 MOCK_CONST_METHOD0(ShouldOfferToSaveInChrome, bool()); |
29 MOCK_METHOD0(MenuModelForAccountChooser, ui::MenuModel*()); | 29 MOCK_METHOD0(MenuModelForAccountChooser, ui::MenuModel*()); |
30 virtual gfx::Image AccountChooserImage() OVERRIDE; | 30 MOCK_METHOD0(AccountChooserImage, gfx::Image()); |
31 virtual bool ShouldShowProgressBar() const OVERRIDE; | 31 MOCK_CONST_METHOD0(ShouldShowProgressBar, bool()); |
32 virtual int GetDialogButtons() const OVERRIDE; | 32 MOCK_CONST_METHOD0(GetDialogButtons, int()); |
33 virtual bool ShouldShowDetailArea() const OVERRIDE; | 33 MOCK_CONST_METHOD0(ShouldShowDetailArea, bool()); |
34 virtual bool IsDialogButtonEnabled(ui::DialogButton button) const OVERRIDE; | 34 MOCK_CONST_METHOD1(IsDialogButtonEnabled, bool(ui::DialogButton button)); |
35 virtual DialogOverlayState GetDialogOverlay() const OVERRIDE; | 35 MOCK_CONST_METHOD0(GetDialogOverlay, DialogOverlayState()); |
36 virtual const std::vector<ui::Range>& LegalDocumentLinks() OVERRIDE; | 36 MOCK_METHOD0(LegalDocumentLinks, const std::vector<ui::Range>&()); |
37 MOCK_CONST_METHOD1(SectionIsActive, bool(DialogSection)); | 37 MOCK_CONST_METHOD1(SectionIsActive, bool(DialogSection)); |
38 MOCK_CONST_METHOD1(RequestedFieldsForSection, | 38 MOCK_CONST_METHOD1(RequestedFieldsForSection, |
39 const DetailInputs&(DialogSection)); | 39 const DetailInputs&(DialogSection)); |
40 MOCK_METHOD1(ComboboxModelForAutofillType, | 40 MOCK_METHOD1(ComboboxModelForAutofillType, |
41 ui::ComboboxModel*(AutofillFieldType)); | 41 ui::ComboboxModel*(AutofillFieldType)); |
42 MOCK_METHOD1(MenuModelForSection, ui::MenuModel*(DialogSection)); | 42 MOCK_METHOD1(MenuModelForSection, ui::MenuModel*(DialogSection)); |
43 virtual string16 LabelForSection(DialogSection section) const OVERRIDE; | 43 MOCK_CONST_METHOD1(LabelForSection, string16(DialogSection section)); |
44 virtual SuggestionState SuggestionStateForSection( | 44 MOCK_METHOD1(SuggestionStateForSection, SuggestionState(DialogSection)); |
45 DialogSection section) OVERRIDE; | 45 MOCK_METHOD1(EditClickedForSection, void(DialogSection section)); |
46 virtual void EditClickedForSection(DialogSection section) OVERRIDE; | 46 MOCK_METHOD1(EditCancelledForSection, void(DialogSection section)); |
47 virtual void EditCancelledForSection(DialogSection section) OVERRIDE; | 47 MOCK_CONST_METHOD2(IconForField, |
48 virtual gfx::Image IconForField(AutofillFieldType type, | 48 gfx::Image(AutofillFieldType, const string16&)); |
49 const string16& user_input) const OVERRIDE; | 49 MOCK_METHOD3(InputValidityMessage, |
50 virtual string16 InputValidityMessage( | 50 string16(DialogSection, AutofillFieldType, const string16&)); |
51 DialogSection section, | |
52 AutofillFieldType type, | |
53 const string16& value) OVERRIDE; | |
54 MOCK_METHOD3(InputsAreValid, ValidityData(DialogSection, | 51 MOCK_METHOD3(InputsAreValid, ValidityData(DialogSection, |
55 const DetailOutputMap&, | 52 const DetailOutputMap&, |
56 ValidationType)); | 53 ValidationType)); |
57 virtual void UserEditedOrActivatedInput(DialogSection section, | 54 MOCK_METHOD6(UserEditedOrActivatedInput,void(DialogSection, |
58 const DetailInput* input, | 55 const DetailInput*, |
59 gfx::NativeView parent_view, | 56 gfx::NativeView, |
60 const gfx::Rect& content_bounds, | 57 const gfx::Rect&, |
61 const string16& field_contents, | 58 const string16&, |
62 bool was_edit) OVERRIDE; | 59 bool was_edit)); |
63 virtual bool HandleKeyPressEventInInput( | 60 MOCK_METHOD1(HandleKeyPressEventInInput, |
64 const content::NativeWebKeyboardEvent& event) OVERRIDE; | 61 bool(const content::NativeWebKeyboardEvent& event)); |
65 | 62 MOCK_METHOD0(FocusMoved, void()); |
66 virtual void FocusMoved() OVERRIDE; | 63 MOCK_CONST_METHOD0(SplashPageImage, gfx::Image()); |
67 | 64 MOCK_METHOD0(ViewClosed, void()); |
68 virtual gfx::Image SplashPageImage() const OVERRIDE; | 65 MOCK_METHOD0(CurrentNotifications,std::vector<DialogNotification>()); |
69 | 66 MOCK_CONST_METHOD0(CurrentAutocheckoutSteps, |
70 virtual void ViewClosed() OVERRIDE; | 67 std::vector<DialogAutocheckoutStep>()); |
71 | 68 MOCK_METHOD0(SignInLinkClicked, void()); |
72 virtual std::vector<DialogNotification> CurrentNotifications() OVERRIDE; | 69 MOCK_METHOD2(NotificationCheckboxStateChanged, |
73 | 70 void(DialogNotification::Type, bool)); |
74 virtual std::vector<DialogAutocheckoutStep> CurrentAutocheckoutSteps() | 71 MOCK_METHOD1(LegalDocumentLinkClicked, void(const ui::Range&)); |
75 const OVERRIDE; | 72 MOCK_METHOD0(OverlayButtonPressed, void()); |
76 | 73 MOCK_METHOD0(OnCancel, void()); |
77 virtual void SignInLinkClicked() OVERRIDE; | 74 MOCK_METHOD0(OnAccept, void()); |
78 virtual void NotificationCheckboxStateChanged(DialogNotification::Type type, | |
79 bool checked) OVERRIDE; | |
80 | |
81 virtual void LegalDocumentLinkClicked(const ui::Range& range) OVERRIDE; | |
82 virtual void OverlayButtonPressed() OVERRIDE; | |
83 virtual void OnCancel() OVERRIDE; | |
84 virtual void OnAccept() OVERRIDE; | |
85 | |
86 MOCK_METHOD0(profile, Profile*()); | 75 MOCK_METHOD0(profile, Profile*()); |
87 virtual content::WebContents* web_contents() OVERRIDE; | 76 MOCK_METHOD0(web_contents, content::WebContents*()); |
88 private: | 77 private: |
89 DetailInputs default_inputs_; | 78 DetailInputs default_inputs_; |
90 DetailInputs cc_default_inputs_; // Default inputs for SECTION_CC. | 79 DetailInputs cc_default_inputs_; // Default inputs for SECTION_CC. |
91 std::vector<ui::Range> range_; | 80 std::vector<ui::Range> range_; |
92 }; | 81 }; |
93 | 82 |
94 } // namespace autofill | 83 } // namespace autofill |
95 | 84 |
96 #endif // CHROME_BROWSER_UI_AUTOFILL_MOCK_AUTOFILL_DIALOG_CONTROLLER_H_ | 85 #endif // CHROME_BROWSER_UI_AUTOFILL_MOCK_AUTOFILL_DIALOG_CONTROLLER_H_ |
OLD | NEW |