summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/autofill/mock_autofill_dialog_controller.cc
blob: 5dba68f4c4942275a39b81a68bc581ddfd2513d6 (plain)
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
// Copyright (c) 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.

#include "chrome/browser/ui/autofill/mock_autofill_dialog_controller.h"
#include "testing/gmock/include/gmock/gmock.h"

namespace autofill {

MockAutofillDialogController::MockAutofillDialogController() {
  testing::DefaultValue<const DetailInputs&>::Set(default_inputs_);
  testing::DefaultValue<ui::ComboboxModel*>::Set(NULL);
}

MockAutofillDialogController::~MockAutofillDialogController() {
  testing::DefaultValue<ui::ComboboxModel*>::Clear();
  testing::DefaultValue<const DetailInputs&>::Clear();
}

string16 MockAutofillDialogController::DialogTitle() const {
  return string16();
}

string16 MockAutofillDialogController::AccountChooserText() const {
  return string16();
}

string16 MockAutofillDialogController::SignInLinkText() const {
  return string16();
}

string16 MockAutofillDialogController::EditSuggestionText() const {
  return string16();
}

string16 MockAutofillDialogController::CancelButtonText() const {
  return string16();
}

string16 MockAutofillDialogController::ConfirmButtonText() const {
  return string16();
}

string16 MockAutofillDialogController::SaveLocallyText() const {
  return string16();
}

string16 MockAutofillDialogController::ProgressBarText() const {
  return string16();
}

string16 MockAutofillDialogController::LegalDocumentsText() {
  return string16();
}

DialogSignedInState MockAutofillDialogController::SignedInState() const {
   return REQUIRES_RESPONSE;
}

bool MockAutofillDialogController::ShouldShowSpinner() const {
  return false;
}

bool MockAutofillDialogController::ShouldOfferToSaveInChrome() const {
   return false;
}

gfx::Image MockAutofillDialogController::AccountChooserImage() {
  return gfx::Image();
}

bool MockAutofillDialogController::ShouldShowProgressBar() const {
  return false;
}

int MockAutofillDialogController::GetDialogButtons() const {
  return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL;
}

bool MockAutofillDialogController::ShouldShowDetailArea() const {
  return false;
}

bool MockAutofillDialogController::IsDialogButtonEnabled(
    ui::DialogButton button) const {
  return false;
}

const std::vector<ui::Range>&
    MockAutofillDialogController::LegalDocumentLinks() {
  return range_;
}

bool MockAutofillDialogController::SectionIsActive(
    DialogSection section) const {
  return false;
}

string16 MockAutofillDialogController::LabelForSection(
    DialogSection section) const {
  return string16();
}

SuggestionState MockAutofillDialogController::SuggestionStateForSection(
    DialogSection section) {
  return SuggestionState(string16(),
                         gfx::Font::NORMAL,
                         gfx::Image(),
                         string16(),
                         gfx::Image(),
                         false);
}

void MockAutofillDialogController::EditClickedForSection(
    DialogSection section) {}

void MockAutofillDialogController::EditCancelledForSection(
    DialogSection section) {}

gfx::Image MockAutofillDialogController::IconForField(
    AutofillFieldType type, const string16& user_input) const {
   return gfx::Image();
}

string16 MockAutofillDialogController::InputValidityMessage(
    AutofillFieldType type,
    const string16& value) const {
  return string16();
}

ValidityData MockAutofillDialogController::InputsAreValid(
     const DetailOutputMap& inputs,
     ValidationType validation_type) const {
  return ValidityData();
}

void MockAutofillDialogController::UserEditedOrActivatedInput(
    const DetailInput* input,
    gfx::NativeView parent_view,
    const gfx::Rect& content_bounds,
    const string16& field_contents,
    bool was_edit) {
}

bool MockAutofillDialogController::HandleKeyPressEventInInput(
     const content::NativeWebKeyboardEvent& event) {
  return false;
}

void MockAutofillDialogController::FocusMoved() {
}

void MockAutofillDialogController::ViewClosed() {
}

std::vector<DialogNotification>
    MockAutofillDialogController::CurrentNotifications() const {
  return std::vector<DialogNotification>();
}

void MockAutofillDialogController::SignInLinkClicked() {}

void MockAutofillDialogController::NotificationCheckboxStateChanged(
    DialogNotification::Type type,
    bool checked) {}

void MockAutofillDialogController::LegalDocumentLinkClicked(
    const ui::Range& range) {}

void MockAutofillDialogController::OnCancel() {}

void MockAutofillDialogController::OnAccept() {}

content::WebContents* MockAutofillDialogController::web_contents() {
  return NULL;
}

}  // namespace autofill