File: mock_autofill_dialog_view_delegate.h

package info (click to toggle)
chromium-browser 41.0.2272.118-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 2,189,132 kB
  • sloc: cpp: 9,691,462; ansic: 3,341,451; python: 712,689; asm: 518,779; xml: 208,926; java: 169,820; sh: 119,353; perl: 68,907; makefile: 28,311; yacc: 13,305; objc: 11,385; tcl: 3,186; cs: 2,225; sql: 2,217; lex: 2,215; lisp: 1,349; pascal: 1,256; awk: 407; ruby: 155; sed: 53; php: 14; exp: 11
file content (102 lines) | stat: -rw-r--r-- 4,932 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_UI_AUTOFILL_MOCK_AUTOFILL_DIALOG_VIEW_DELEGATE_H_
#define CHROME_BROWSER_UI_AUTOFILL_MOCK_AUTOFILL_DIALOG_VIEW_DELEGATE_H_

#include "base/basictypes.h"
#include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "ui/gfx/range/range.h"

namespace autofill {

class MockAutofillDialogViewDelegate : public AutofillDialogViewDelegate {
 public:
  MockAutofillDialogViewDelegate();
  virtual ~MockAutofillDialogViewDelegate();

  MOCK_CONST_METHOD0(DialogTitle, base::string16());
  MOCK_CONST_METHOD0(AccountChooserText, base::string16());
  MOCK_CONST_METHOD0(SignInLinkText, base::string16());
  MOCK_CONST_METHOD0(SpinnerText, base::string16());
  MOCK_CONST_METHOD0(EditSuggestionText, base::string16());
  MOCK_CONST_METHOD0(CancelButtonText, base::string16());
  MOCK_CONST_METHOD0(ConfirmButtonText, base::string16());
  MOCK_CONST_METHOD0(SaveLocallyText, base::string16());
  MOCK_CONST_METHOD0(SaveLocallyTooltip, base::string16());
  MOCK_METHOD0(LegalDocumentsText, base::string16());
  MOCK_CONST_METHOD0(ShouldShowSpinner, bool());
  MOCK_CONST_METHOD0(ShouldShowAccountChooser, bool());
  MOCK_CONST_METHOD0(ShouldShowSignInWebView, bool());
  MOCK_CONST_METHOD0(SignInUrl, GURL());
  MOCK_CONST_METHOD0(ShouldOfferToSaveInChrome, bool());
  MOCK_CONST_METHOD0(ShouldSaveInChrome, bool());
  MOCK_METHOD0(MenuModelForAccountChooser, ui::MenuModel*());
  MOCK_METHOD0(AccountChooserImage, gfx::Image());
  MOCK_CONST_METHOD0(ShouldShowProgressBar, bool());
  MOCK_CONST_METHOD0(ButtonStripImage, gfx::Image());
  MOCK_CONST_METHOD0(GetDialogButtons, int());
  MOCK_CONST_METHOD1(IsDialogButtonEnabled, bool(ui::DialogButton button));
  MOCK_METHOD0(GetDialogOverlay, DialogOverlayState());
  MOCK_METHOD0(LegalDocumentLinks, const std::vector<gfx::Range>&());
  MOCK_CONST_METHOD1(SectionIsActive, bool(DialogSection));
  MOCK_CONST_METHOD1(RequestedFieldsForSection,
                     const DetailInputs&(DialogSection));
  MOCK_METHOD1(ComboboxModelForAutofillType,
               ui::ComboboxModel*(ServerFieldType));
  MOCK_METHOD1(MenuModelForSection, ui::MenuModel*(DialogSection));
  MOCK_CONST_METHOD1(LabelForSection, base::string16(DialogSection section));
  MOCK_METHOD1(SuggestionStateForSection, SuggestionState(DialogSection));
  MOCK_METHOD1(EditClickedForSection, void(DialogSection section));
  MOCK_METHOD1(EditCancelledForSection, void(DialogSection section));
  MOCK_CONST_METHOD1(IconsForFields, FieldIconMap(const FieldValueMap&));
  MOCK_CONST_METHOD1(FieldControlsIcons, bool(ServerFieldType));
  MOCK_CONST_METHOD1(TooltipForField, base::string16(ServerFieldType));
  MOCK_METHOD2(InputIsEditable, bool(const DetailInput& input,
                                     DialogSection section));
  MOCK_METHOD3(InputValidityMessage,
      base::string16(DialogSection, ServerFieldType, const base::string16&));
  MOCK_METHOD2(InputsAreValid, ValidityMessages(DialogSection,
                                                const FieldValueMap&));
  MOCK_METHOD6(UserEditedOrActivatedInput, void(DialogSection,
                                                ServerFieldType,
                                                gfx::NativeView,
                                                const gfx::Rect&,
                                                const base::string16&,
                                                bool was_edit));
  MOCK_METHOD1(HandleKeyPressEventInInput,
               bool(const content::NativeWebKeyboardEvent& event));
  MOCK_METHOD0(FocusMoved, void());
  MOCK_CONST_METHOD0(ShouldShowErrorBubble, bool());
  MOCK_METHOD0(ViewClosed, void());
  MOCK_METHOD0(CurrentNotifications,std::vector<DialogNotification>());
  MOCK_METHOD1(LinkClicked, void(const GURL&));
  MOCK_METHOD0(SignInLinkClicked, void());
  MOCK_METHOD2(NotificationCheckboxStateChanged,
               void(DialogNotification::Type, bool));
  MOCK_METHOD1(LegalDocumentLinkClicked, void(const gfx::Range&));
  MOCK_METHOD0(OverlayButtonPressed, void());
  MOCK_METHOD0(OnCancel, bool());
  MOCK_METHOD0(OnAccept, bool());
  MOCK_METHOD0(profile, Profile*());
  MOCK_METHOD0(GetWebContents, content::WebContents*());

  // Set which web contents initiated showing the dialog.
  void SetWebContents(content::WebContents* contents);

  // Set which profile to use for mock |profile()| calls.
  void SetProfile(Profile* profile);

 private:
  DetailInputs default_inputs_;
  DetailInputs cc_default_inputs_;  // Default inputs for SECTION_CC.
  std::vector<gfx::Range> range_;

  DISALLOW_COPY_AND_ASSIGN(MockAutofillDialogViewDelegate);
};

}  // namespace autofill

#endif  // CHROME_BROWSER_UI_AUTOFILL_MOCK_AUTOFILL_DIALOG_VIEW_DELEGATE_H_