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 <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 void UpdateProgressBar(double value); | 88 void UpdateProgressBar(double value); |
89 | 89 |
90 // Called when there is an error in an active Autocheckout flow. | 90 // Called when there is an error in an active Autocheckout flow. |
91 void OnAutocheckoutError(); | 91 void OnAutocheckoutError(); |
92 | 92 |
93 // AutofillDialogController implementation. | 93 // AutofillDialogController implementation. |
94 virtual string16 DialogTitle() const OVERRIDE; | 94 virtual string16 DialogTitle() const OVERRIDE; |
95 virtual string16 AccountChooserText() const OVERRIDE; | 95 virtual string16 AccountChooserText() const OVERRIDE; |
96 virtual string16 SignInLinkText() const OVERRIDE; | 96 virtual string16 SignInLinkText() const OVERRIDE; |
97 virtual string16 EditSuggestionText() const OVERRIDE; | 97 virtual string16 EditSuggestionText() const OVERRIDE; |
98 virtual string16 UseBillingForShippingText() const OVERRIDE; | |
99 virtual string16 CancelButtonText() const OVERRIDE; | 98 virtual string16 CancelButtonText() const OVERRIDE; |
100 virtual string16 ConfirmButtonText() const OVERRIDE; | 99 virtual string16 ConfirmButtonText() const OVERRIDE; |
101 virtual string16 SaveLocallyText() const OVERRIDE; | 100 virtual string16 SaveLocallyText() const OVERRIDE; |
102 virtual string16 CancelSignInText() const OVERRIDE; | 101 virtual string16 CancelSignInText() const OVERRIDE; |
103 virtual string16 ProgressBarText() const OVERRIDE; | 102 virtual string16 ProgressBarText() const OVERRIDE; |
104 virtual string16 LegalDocumentsText() OVERRIDE; | 103 virtual string16 LegalDocumentsText() OVERRIDE; |
105 virtual DialogSignedInState SignedInState() const OVERRIDE; | 104 virtual DialogSignedInState SignedInState() const OVERRIDE; |
106 virtual bool ShouldShowSpinner() const OVERRIDE; | 105 virtual bool ShouldShowSpinner() const OVERRIDE; |
107 virtual bool ShouldOfferToSaveInChrome() const OVERRIDE; | 106 virtual bool ShouldOfferToSaveInChrome() const OVERRIDE; |
108 virtual ui::MenuModel* MenuModelForAccountChooser() OVERRIDE; | 107 virtual ui::MenuModel* MenuModelForAccountChooser() OVERRIDE; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 virtual void RemoveSuggestion(const string16& value, | 156 virtual void RemoveSuggestion(const string16& value, |
158 int identifier) OVERRIDE; | 157 int identifier) OVERRIDE; |
159 virtual void ClearPreviewedForm() OVERRIDE; | 158 virtual void ClearPreviewedForm() OVERRIDE; |
160 | 159 |
161 // content::NotificationObserver implementation. | 160 // content::NotificationObserver implementation. |
162 virtual void Observe(int type, | 161 virtual void Observe(int type, |
163 const content::NotificationSource& source, | 162 const content::NotificationSource& source, |
164 const content::NotificationDetails& details) OVERRIDE; | 163 const content::NotificationDetails& details) OVERRIDE; |
165 | 164 |
166 // SuggestionsMenuModelDelegate implementation. | 165 // SuggestionsMenuModelDelegate implementation. |
167 virtual void SuggestionItemSelected(const SuggestionsMenuModel& model) | 166 virtual void SuggestionItemSelected(SuggestionsMenuModel* model, |
168 OVERRIDE; | 167 const std::string& item_key) OVERRIDE; |
169 | 168 |
170 // wallet::WalletClientDelegate implementation. | 169 // wallet::WalletClientDelegate implementation. |
171 virtual const AutofillMetrics& GetMetricLogger() const OVERRIDE; | 170 virtual const AutofillMetrics& GetMetricLogger() const OVERRIDE; |
172 virtual DialogType GetDialogType() const OVERRIDE; | 171 virtual DialogType GetDialogType() const OVERRIDE; |
173 virtual std::string GetRiskData() const OVERRIDE; | 172 virtual std::string GetRiskData() const OVERRIDE; |
174 virtual void OnDidAcceptLegalDocuments() OVERRIDE; | 173 virtual void OnDidAcceptLegalDocuments() OVERRIDE; |
175 virtual void OnDidAuthenticateInstrument(bool success) OVERRIDE; | 174 virtual void OnDidAuthenticateInstrument(bool success) OVERRIDE; |
176 virtual void OnDidGetFullWallet( | 175 virtual void OnDidGetFullWallet( |
177 scoped_ptr<wallet::FullWallet> full_wallet) OVERRIDE; | 176 scoped_ptr<wallet::FullWallet> full_wallet) OVERRIDE; |
178 virtual void OnDidGetWalletItems( | 177 virtual void OnDidGetWalletItems( |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 // FillOutputForSection. | 302 // FillOutputForSection. |
304 void FillFormStructureForSection(const FormGroup& form_group, | 303 void FillFormStructureForSection(const FormGroup& form_group, |
305 size_t variant, | 304 size_t variant, |
306 DialogSection section, | 305 DialogSection section, |
307 const InputFieldComparator& compare); | 306 const InputFieldComparator& compare); |
308 | 307 |
309 // Sets the CVC result on |form_structure_| to the value in |cvc|. | 308 // Sets the CVC result on |form_structure_| to the value in |cvc|. |
310 void SetCvcResult(const string16& cvc); | 309 void SetCvcResult(const string16& cvc); |
311 | 310 |
312 // Gets the SuggestionsMenuModel for |section|. | 311 // Gets the SuggestionsMenuModel for |section|. |
313 SuggestionsMenuModel* SuggestionsMenuModelForSection(DialogSection section); | 312 SuggestionsMenuModel* SuggestionsMenuModelForSection( |
| 313 DialogSection section); |
| 314 const SuggestionsMenuModel* SuggestionsMenuModelForSection( |
| 315 DialogSection section) const; |
314 // And the reverse. | 316 // And the reverse. |
315 DialogSection SectionForSuggestionsMenuModel( | 317 DialogSection SectionForSuggestionsMenuModel( |
316 const SuggestionsMenuModel& model); | 318 const SuggestionsMenuModel& model); |
317 | 319 |
318 // Suggested text and icons for sections. Suggestion text is used to show an | 320 // Suggested text and icons for sections. Suggestion text is used to show an |
319 // abidged overview of the currently used suggestion. Extra text is used when | 321 // abidged overview of the currently used suggestion. Extra text is used when |
320 // part of a section is suggested but part must be manually input (e.g. during | 322 // part of a section is suggested but part must be manually input (e.g. during |
321 // a CVC challenge or when using Autofill's CC section [never stores CVC]). | 323 // a CVC challenge or when using Autofill's CC section [never stores CVC]). |
322 string16 SuggestionTextForSection(DialogSection section); | 324 string16 SuggestionTextForSection(DialogSection section); |
| 325 gfx::Font::FontStyle SuggestionTextStyleForSection(DialogSection section) |
| 326 const; |
323 string16 RequiredActionTextForSection(DialogSection section) const; | 327 string16 RequiredActionTextForSection(DialogSection section) const; |
324 gfx::Image SuggestionIconForSection(DialogSection section); | 328 gfx::Image SuggestionIconForSection(DialogSection section); |
325 string16 ExtraSuggestionTextForSection(DialogSection section) const; | 329 string16 ExtraSuggestionTextForSection(DialogSection section) const; |
326 gfx::Image ExtraSuggestionIconForSection(DialogSection section) const; | 330 gfx::Image ExtraSuggestionIconForSection(DialogSection section) const; |
327 | 331 |
328 // Whether |section| should be showing an "Edit" link. | 332 // Whether |section| should be showing an "Edit" link. |
329 bool EditEnabledForSection(DialogSection section) const; | 333 bool EditEnabledForSection(DialogSection section) const; |
330 | 334 |
331 // Loads profiles that can suggest data for |type|. |field_contents| is the | 335 // Loads profiles that can suggest data for |type|. |field_contents| is the |
332 // part the user has already typed. |inputs| is the rest of section. | 336 // part the user has already typed. |inputs| is the rest of section. |
(...skipping 15 matching lines...) Expand all Loading... |
348 | 352 |
349 // Asks risk module to asynchronously load fingerprint data. Data will be | 353 // Asks risk module to asynchronously load fingerprint data. Data will be |
350 // returned via OnDidLoadRiskFingerprintData. | 354 // returned via OnDidLoadRiskFingerprintData. |
351 void LoadRiskFingerprintData(); | 355 void LoadRiskFingerprintData(); |
352 void OnDidLoadRiskFingerprintData(scoped_ptr<risk::Fingerprint> fingerprint); | 356 void OnDidLoadRiskFingerprintData(scoped_ptr<risk::Fingerprint> fingerprint); |
353 | 357 |
354 // Whether the user has chosen to enter all new data in |section|. This | 358 // Whether the user has chosen to enter all new data in |section|. This |
355 // happens via choosing "Add a new X..." from a section's suggestion menu. | 359 // happens via choosing "Add a new X..." from a section's suggestion menu. |
356 bool IsManuallyEditingSection(DialogSection section); | 360 bool IsManuallyEditingSection(DialogSection section); |
357 | 361 |
| 362 // Returns true if |key| refers to a suggestion, as opposed to some control |
| 363 // menu item. |
| 364 bool IsASuggestionItemKey(const std::string& key); |
| 365 |
358 // Whether the billing section should be used to fill in the shipping details. | 366 // Whether the billing section should be used to fill in the shipping details. |
359 bool ShouldUseBillingForShipping(); | 367 bool ShouldUseBillingForShipping(); |
360 | 368 |
361 // Whether the user wishes to save information locally to Autofill. | 369 // Whether the user wishes to save information locally to Autofill. |
362 bool ShouldSaveDetailsLocally(); | 370 bool ShouldSaveDetailsLocally(); |
363 | 371 |
364 // Change whether the controller is currently submitting details to Autofill | 372 // Change whether the controller is currently submitting details to Autofill |
365 // or Online Wallet (|is_submitting_|) and update the view. | 373 // or Online Wallet (|is_submitting_|) and update the view. |
366 void SetIsSubmitting(bool submitting); | 374 void SetIsSubmitting(bool submitting); |
367 | 375 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 | 507 |
500 // Whether or not there was an error in the Autocheckout flow. | 508 // Whether or not there was an error in the Autocheckout flow. |
501 bool had_autocheckout_error_; | 509 bool had_autocheckout_error_; |
502 | 510 |
503 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); | 511 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); |
504 }; | 512 }; |
505 | 513 |
506 } // namespace autofill | 514 } // namespace autofill |
507 | 515 |
508 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 516 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
OLD | NEW |