OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 public content::NotificationObserver, | 79 public content::NotificationObserver, |
80 public content::WebContentsObserver, | 80 public content::WebContentsObserver, |
81 public SuggestionsMenuModelDelegate, | 81 public SuggestionsMenuModelDelegate, |
82 public wallet::WalletClientDelegate, | 82 public wallet::WalletClientDelegate, |
83 public wallet::WalletSigninHelperDelegate, | 83 public wallet::WalletSigninHelperDelegate, |
84 public PersonalDataManagerObserver, | 84 public PersonalDataManagerObserver, |
85 public AccountChooserModelDelegate, | 85 public AccountChooserModelDelegate, |
86 public gfx::AnimationDelegate, | 86 public gfx::AnimationDelegate, |
87 public LoadRulesListener { | 87 public LoadRulesListener { |
88 public: | 88 public: |
89 virtual ~AutofillDialogControllerImpl(); | 89 ~AutofillDialogControllerImpl() override; |
90 | 90 |
91 static base::WeakPtr<AutofillDialogControllerImpl> Create( | 91 static base::WeakPtr<AutofillDialogControllerImpl> Create( |
92 content::WebContents* contents, | 92 content::WebContents* contents, |
93 const FormData& form_structure, | 93 const FormData& form_structure, |
94 const GURL& source_url, | 94 const GURL& source_url, |
95 const AutofillClient::ResultCallback& callback); | 95 const AutofillClient::ResultCallback& callback); |
96 | 96 |
97 // AutofillDialogController implementation. | 97 // AutofillDialogController implementation. |
98 virtual void Show() override; | 98 void Show() override; |
99 virtual void Hide() override; | 99 void Hide() override; |
100 virtual void TabActivated() override; | 100 void TabActivated() override; |
101 | 101 |
102 // AutofillDialogViewDelegate implementation. | 102 // AutofillDialogViewDelegate implementation. |
103 virtual base::string16 DialogTitle() const override; | 103 base::string16 DialogTitle() const override; |
104 virtual base::string16 AccountChooserText() const override; | 104 base::string16 AccountChooserText() const override; |
105 virtual base::string16 SignInLinkText() const override; | 105 base::string16 SignInLinkText() const override; |
106 virtual base::string16 SpinnerText() const override; | 106 base::string16 SpinnerText() const override; |
107 virtual base::string16 EditSuggestionText() const override; | 107 base::string16 EditSuggestionText() const override; |
108 virtual base::string16 CancelButtonText() const override; | 108 base::string16 CancelButtonText() const override; |
109 virtual base::string16 ConfirmButtonText() const override; | 109 base::string16 ConfirmButtonText() const override; |
110 virtual base::string16 SaveLocallyText() const override; | 110 base::string16 SaveLocallyText() const override; |
111 virtual base::string16 SaveLocallyTooltip() const override; | 111 base::string16 SaveLocallyTooltip() const override; |
112 virtual base::string16 LegalDocumentsText() override; | 112 base::string16 LegalDocumentsText() override; |
113 virtual bool ShouldShowSpinner() const override; | 113 bool ShouldShowSpinner() const override; |
114 virtual bool ShouldShowAccountChooser() const override; | 114 bool ShouldShowAccountChooser() const override; |
115 virtual bool ShouldShowSignInWebView() const override; | 115 bool ShouldShowSignInWebView() const override; |
116 virtual bool ShouldOfferToSaveInChrome() const override; | 116 bool ShouldOfferToSaveInChrome() const override; |
117 virtual bool ShouldSaveInChrome() const override; | 117 bool ShouldSaveInChrome() const override; |
118 virtual ui::MenuModel* MenuModelForAccountChooser() override; | 118 ui::MenuModel* MenuModelForAccountChooser() override; |
119 virtual gfx::Image AccountChooserImage() override; | 119 gfx::Image AccountChooserImage() override; |
120 virtual gfx::Image ButtonStripImage() const override; | 120 gfx::Image ButtonStripImage() const override; |
121 virtual int GetDialogButtons() const override; | 121 int GetDialogButtons() const override; |
122 virtual bool IsDialogButtonEnabled(ui::DialogButton button) const override; | 122 bool IsDialogButtonEnabled(ui::DialogButton button) const override; |
123 virtual DialogOverlayState GetDialogOverlay() override; | 123 DialogOverlayState GetDialogOverlay() override; |
124 virtual const std::vector<gfx::Range>& LegalDocumentLinks() override; | 124 const std::vector<gfx::Range>& LegalDocumentLinks() override; |
125 virtual bool SectionIsActive(DialogSection section) const override; | 125 bool SectionIsActive(DialogSection section) const override; |
126 virtual const DetailInputs& RequestedFieldsForSection(DialogSection section) | 126 const DetailInputs& RequestedFieldsForSection( |
127 const override; | 127 DialogSection section) const override; |
128 virtual ui::ComboboxModel* ComboboxModelForAutofillType( | 128 ui::ComboboxModel* ComboboxModelForAutofillType( |
129 ServerFieldType type) override; | 129 ServerFieldType type) override; |
130 virtual ui::MenuModel* MenuModelForSection(DialogSection section) override; | 130 ui::MenuModel* MenuModelForSection(DialogSection section) override; |
131 virtual base::string16 LabelForSection(DialogSection section) const override; | 131 base::string16 LabelForSection(DialogSection section) const override; |
132 virtual SuggestionState SuggestionStateForSection( | 132 SuggestionState SuggestionStateForSection(DialogSection section) override; |
133 DialogSection section) override; | 133 FieldIconMap IconsForFields(const FieldValueMap& user_inputs) const override; |
134 virtual FieldIconMap IconsForFields(const FieldValueMap& user_inputs) | 134 bool FieldControlsIcons(ServerFieldType type) const override; |
135 const override; | 135 base::string16 TooltipForField(ServerFieldType type) const override; |
136 virtual bool FieldControlsIcons(ServerFieldType type) const override; | 136 bool InputIsEditable(const DetailInput& input, |
137 virtual base::string16 TooltipForField(ServerFieldType type) const override; | 137 DialogSection section) override; |
138 virtual bool InputIsEditable(const DetailInput& input, DialogSection section) | 138 base::string16 InputValidityMessage(DialogSection section, |
139 override; | 139 ServerFieldType type, |
140 virtual base::string16 InputValidityMessage(DialogSection section, | 140 const base::string16& value) override; |
141 ServerFieldType type, | 141 ValidityMessages InputsAreValid(DialogSection section, |
142 const base::string16& value) override; | 142 const FieldValueMap& inputs) override; |
143 virtual ValidityMessages InputsAreValid( | 143 void UserEditedOrActivatedInput(DialogSection section, |
144 DialogSection section, const FieldValueMap& inputs) override; | 144 ServerFieldType type, |
145 virtual void UserEditedOrActivatedInput(DialogSection section, | 145 gfx::NativeView parent_view, |
146 ServerFieldType type, | 146 const gfx::Rect& content_bounds, |
147 gfx::NativeView parent_view, | 147 const base::string16& field_contents, |
148 const gfx::Rect& content_bounds, | 148 bool was_edit) override; |
149 const base::string16& field_contents, | 149 bool HandleKeyPressEventInInput( |
150 bool was_edit) override; | |
151 virtual bool HandleKeyPressEventInInput( | |
152 const content::NativeWebKeyboardEvent& event) override; | 150 const content::NativeWebKeyboardEvent& event) override; |
153 virtual void FocusMoved() override; | 151 void FocusMoved() override; |
154 virtual bool ShouldShowErrorBubble() const override; | 152 bool ShouldShowErrorBubble() const override; |
155 virtual void ViewClosed() override; | 153 void ViewClosed() override; |
156 virtual std::vector<DialogNotification> CurrentNotifications() override; | 154 std::vector<DialogNotification> CurrentNotifications() override; |
157 virtual void LinkClicked(const GURL& url) override; | 155 void LinkClicked(const GURL& url) override; |
158 virtual void SignInLinkClicked() override; | 156 void SignInLinkClicked() override; |
159 virtual void NotificationCheckboxStateChanged(DialogNotification::Type type, | 157 void NotificationCheckboxStateChanged(DialogNotification::Type type, |
160 bool checked) override; | 158 bool checked) override; |
161 virtual void LegalDocumentLinkClicked(const gfx::Range& range) override; | 159 void LegalDocumentLinkClicked(const gfx::Range& range) override; |
162 virtual bool OnCancel() override; | 160 bool OnCancel() override; |
163 virtual bool OnAccept() override; | 161 bool OnAccept() override; |
164 virtual Profile* profile() override; | 162 Profile* profile() override; |
165 virtual content::WebContents* GetWebContents() override; | 163 content::WebContents* GetWebContents() override; |
166 | 164 |
167 // AutofillPopupDelegate implementation. | 165 // AutofillPopupDelegate implementation. |
168 virtual void OnPopupShown() override; | 166 void OnPopupShown() override; |
169 virtual void OnPopupHidden() override; | 167 void OnPopupHidden() override; |
170 virtual void DidSelectSuggestion(const base::string16& value, | 168 void DidSelectSuggestion(const base::string16& value, |
171 int identifier) override; | 169 int identifier) override; |
172 virtual void DidAcceptSuggestion(const base::string16& value, | 170 void DidAcceptSuggestion(const base::string16& value, |
173 int identifier) override; | 171 int identifier) override; |
174 virtual void RemoveSuggestion(const base::string16& value, | 172 void RemoveSuggestion(const base::string16& value, int identifier) override; |
175 int identifier) override; | 173 void ClearPreviewedForm() override; |
176 virtual void ClearPreviewedForm() override; | |
177 | 174 |
178 // content::NotificationObserver implementation. | 175 // content::NotificationObserver implementation. |
179 virtual void Observe(int type, | 176 void Observe(int type, |
180 const content::NotificationSource& source, | 177 const content::NotificationSource& source, |
181 const content::NotificationDetails& details) override; | 178 const content::NotificationDetails& details) override; |
182 | 179 |
183 // SuggestionsMenuModelDelegate implementation. | 180 // SuggestionsMenuModelDelegate implementation. |
184 virtual void SuggestionItemSelected(SuggestionsMenuModel* model, | 181 void SuggestionItemSelected(SuggestionsMenuModel* model, |
185 size_t index) override; | 182 size_t index) override; |
186 | 183 |
187 // wallet::WalletClientDelegate implementation. | 184 // wallet::WalletClientDelegate implementation. |
188 virtual const AutofillMetrics& GetMetricLogger() const override; | 185 const AutofillMetrics& GetMetricLogger() const override; |
189 virtual std::string GetRiskData() const override; | 186 std::string GetRiskData() const override; |
190 virtual std::string GetWalletCookieValue() const override; | 187 std::string GetWalletCookieValue() const override; |
191 virtual bool IsShippingAddressRequired() const override; | 188 bool IsShippingAddressRequired() const override; |
192 virtual void OnDidAcceptLegalDocuments() override; | 189 void OnDidAcceptLegalDocuments() override; |
193 virtual void OnDidAuthenticateInstrument(bool success) override; | 190 void OnDidAuthenticateInstrument(bool success) override; |
194 virtual void OnDidGetFullWallet( | 191 void OnDidGetFullWallet(scoped_ptr<wallet::FullWallet> full_wallet) override; |
195 scoped_ptr<wallet::FullWallet> full_wallet) override; | 192 void OnDidGetWalletItems( |
196 virtual void OnDidGetWalletItems( | |
197 scoped_ptr<wallet::WalletItems> wallet_items) override; | 193 scoped_ptr<wallet::WalletItems> wallet_items) override; |
198 virtual void OnDidSaveToWallet( | 194 void OnDidSaveToWallet( |
199 const std::string& instrument_id, | 195 const std::string& instrument_id, |
200 const std::string& address_id, | 196 const std::string& address_id, |
201 const std::vector<wallet::RequiredAction>& required_actions, | 197 const std::vector<wallet::RequiredAction>& required_actions, |
202 const std::vector<wallet::FormFieldError>& form_field_errors) override; | 198 const std::vector<wallet::FormFieldError>& form_field_errors) override; |
203 virtual void OnWalletError( | 199 void OnWalletError(wallet::WalletClient::ErrorType error_type) override; |
204 wallet::WalletClient::ErrorType error_type) override; | |
205 | 200 |
206 // PersonalDataManagerObserver implementation. | 201 // PersonalDataManagerObserver implementation. |
207 virtual void OnPersonalDataChanged() override; | 202 void OnPersonalDataChanged() override; |
208 | 203 |
209 // AccountChooserModelDelegate implementation. | 204 // AccountChooserModelDelegate implementation. |
210 virtual void AccountChoiceChanged() override; | 205 void AccountChoiceChanged() override; |
211 virtual void AddAccount() override; | 206 void AddAccount() override; |
212 virtual void UpdateAccountChooserView() override; | 207 void UpdateAccountChooserView() override; |
213 | 208 |
214 // wallet::WalletSigninHelperDelegate implementation. | 209 // wallet::WalletSigninHelperDelegate implementation. |
215 virtual void OnPassiveSigninSuccess() override; | 210 void OnPassiveSigninSuccess() override; |
216 virtual void OnPassiveSigninFailure( | 211 void OnPassiveSigninFailure(const GoogleServiceAuthError& error) override; |
217 const GoogleServiceAuthError& error) override; | 212 void OnDidFetchWalletCookieValue(const std::string& cookie_value) override; |
218 virtual void OnDidFetchWalletCookieValue( | |
219 const std::string& cookie_value) override; | |
220 | 213 |
221 // gfx::AnimationDelegate implementation. | 214 // gfx::AnimationDelegate implementation. |
222 virtual void AnimationEnded(const gfx::Animation* animation) override; | 215 void AnimationEnded(const gfx::Animation* animation) override; |
223 virtual void AnimationProgressed(const gfx::Animation* animation) override; | 216 void AnimationProgressed(const gfx::Animation* animation) override; |
224 | 217 |
225 // LoadRulesListener implementation. | 218 // LoadRulesListener implementation. |
226 virtual void OnAddressValidationRulesLoaded(const std::string& country_code, | 219 void OnAddressValidationRulesLoaded(const std::string& country_code, |
227 bool success) override; | 220 bool success) override; |
228 | 221 |
229 protected: | 222 protected: |
230 enum DialogSignedInState { | 223 enum DialogSignedInState { |
231 NOT_CHECKED, | 224 NOT_CHECKED, |
232 REQUIRES_RESPONSE, | 225 REQUIRES_RESPONSE, |
233 REQUIRES_SIGN_IN, | 226 REQUIRES_SIGN_IN, |
234 REQUIRES_PASSIVE_SIGN_IN, | 227 REQUIRES_PASSIVE_SIGN_IN, |
235 SIGNED_IN, | 228 SIGNED_IN, |
236 SIGN_IN_DISABLED, | 229 SIGN_IN_DISABLED, |
237 }; | 230 }; |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 base::string16 submitted_cardholder_name_; | 847 base::string16 submitted_cardholder_name_; |
855 | 848 |
856 base::WeakPtrFactory<AutofillDialogControllerImpl> weak_ptr_factory_; | 849 base::WeakPtrFactory<AutofillDialogControllerImpl> weak_ptr_factory_; |
857 | 850 |
858 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); | 851 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); |
859 }; | 852 }; |
860 | 853 |
861 } // namespace autofill | 854 } // namespace autofill |
862 | 855 |
863 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 856 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
OLD | NEW |