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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 void UpdateProgressBar(double value); | 89 void UpdateProgressBar(double value); |
90 | 90 |
91 // Called when there is an error in an active Autocheckout flow. | 91 // Called when there is an error in an active Autocheckout flow. |
92 void OnAutocheckoutError(); | 92 void OnAutocheckoutError(); |
93 | 93 |
94 // AutofillDialogController implementation. | 94 // AutofillDialogController implementation. |
95 virtual string16 DialogTitle() const OVERRIDE; | 95 virtual string16 DialogTitle() const OVERRIDE; |
96 virtual string16 AccountChooserText() const OVERRIDE; | 96 virtual string16 AccountChooserText() const OVERRIDE; |
97 virtual string16 SignInLinkText() const OVERRIDE; | 97 virtual string16 SignInLinkText() const OVERRIDE; |
98 virtual string16 EditSuggestionText() const OVERRIDE; | 98 virtual string16 EditSuggestionText() const OVERRIDE; |
| 99 virtual string16 UseBillingForShippingText() const OVERRIDE; |
99 virtual string16 CancelButtonText() const OVERRIDE; | 100 virtual string16 CancelButtonText() const OVERRIDE; |
100 virtual string16 ConfirmButtonText() const OVERRIDE; | 101 virtual string16 ConfirmButtonText() const OVERRIDE; |
101 virtual string16 SaveLocallyText() const OVERRIDE; | 102 virtual string16 SaveLocallyText() const OVERRIDE; |
102 virtual string16 CancelSignInText() const OVERRIDE; | 103 virtual string16 CancelSignInText() const OVERRIDE; |
103 virtual string16 ProgressBarText() const OVERRIDE; | 104 virtual string16 ProgressBarText() const OVERRIDE; |
104 virtual string16 LegalDocumentsText() OVERRIDE; | 105 virtual string16 LegalDocumentsText() OVERRIDE; |
105 virtual DialogSignedInState SignedInState() const OVERRIDE; | 106 virtual DialogSignedInState SignedInState() const OVERRIDE; |
106 virtual bool ShouldShowSpinner() const OVERRIDE; | 107 virtual bool ShouldShowSpinner() const OVERRIDE; |
107 virtual bool ShouldOfferToSaveInChrome() const OVERRIDE; | 108 virtual bool ShouldOfferToSaveInChrome() const OVERRIDE; |
108 virtual ui::MenuModel* MenuModelForAccountChooser() OVERRIDE; | 109 virtual ui::MenuModel* MenuModelForAccountChooser() OVERRIDE; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 virtual void RemoveSuggestion(const string16& value, | 159 virtual void RemoveSuggestion(const string16& value, |
159 int identifier) OVERRIDE; | 160 int identifier) OVERRIDE; |
160 virtual void ClearPreviewedForm() OVERRIDE; | 161 virtual void ClearPreviewedForm() OVERRIDE; |
161 | 162 |
162 // content::NotificationObserver implementation. | 163 // content::NotificationObserver implementation. |
163 virtual void Observe(int type, | 164 virtual void Observe(int type, |
164 const content::NotificationSource& source, | 165 const content::NotificationSource& source, |
165 const content::NotificationDetails& details) OVERRIDE; | 166 const content::NotificationDetails& details) OVERRIDE; |
166 | 167 |
167 // SuggestionsMenuModelDelegate implementation. | 168 // SuggestionsMenuModelDelegate implementation. |
168 virtual void SuggestionItemSelected(SuggestionsMenuModel* model, | 169 virtual void SuggestionItemSelected(const SuggestionsMenuModel& model) |
169 size_t index) OVERRIDE; | 170 OVERRIDE; |
170 | 171 |
171 // wallet::WalletClientDelegate implementation. | 172 // wallet::WalletClientDelegate implementation. |
172 virtual const AutofillMetrics& GetMetricLogger() const OVERRIDE; | 173 virtual const AutofillMetrics& GetMetricLogger() const OVERRIDE; |
173 virtual DialogType GetDialogType() const OVERRIDE; | 174 virtual DialogType GetDialogType() const OVERRIDE; |
174 virtual std::string GetRiskData() const OVERRIDE; | 175 virtual std::string GetRiskData() const OVERRIDE; |
175 virtual void OnDidAcceptLegalDocuments() OVERRIDE; | 176 virtual void OnDidAcceptLegalDocuments() OVERRIDE; |
176 virtual void OnDidAuthenticateInstrument(bool success) OVERRIDE; | 177 virtual void OnDidAuthenticateInstrument(bool success) OVERRIDE; |
177 virtual void OnDidGetFullWallet( | 178 virtual void OnDidGetFullWallet( |
178 scoped_ptr<wallet::FullWallet> full_wallet) OVERRIDE; | 179 scoped_ptr<wallet::FullWallet> full_wallet) OVERRIDE; |
179 virtual void OnDidGetWalletItems( | 180 virtual void OnDidGetWalletItems( |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 DialogSection section) const; | 319 DialogSection section) const; |
319 // And the reverse. | 320 // And the reverse. |
320 DialogSection SectionForSuggestionsMenuModel( | 321 DialogSection SectionForSuggestionsMenuModel( |
321 const SuggestionsMenuModel& model); | 322 const SuggestionsMenuModel& model); |
322 | 323 |
323 // Suggested text and icons for sections. Suggestion text is used to show an | 324 // Suggested text and icons for sections. Suggestion text is used to show an |
324 // abidged overview of the currently used suggestion. Extra text is used when | 325 // abidged overview of the currently used suggestion. Extra text is used when |
325 // part of a section is suggested but part must be manually input (e.g. during | 326 // part of a section is suggested but part must be manually input (e.g. during |
326 // a CVC challenge or when using Autofill's CC section [never stores CVC]). | 327 // a CVC challenge or when using Autofill's CC section [never stores CVC]). |
327 string16 SuggestionTextForSection(DialogSection section); | 328 string16 SuggestionTextForSection(DialogSection section); |
328 gfx::Font::FontStyle SuggestionTextStyleForSection(DialogSection section) | |
329 const; | |
330 string16 RequiredActionTextForSection(DialogSection section) const; | 329 string16 RequiredActionTextForSection(DialogSection section) const; |
331 gfx::Image SuggestionIconForSection(DialogSection section); | 330 gfx::Image SuggestionIconForSection(DialogSection section); |
332 string16 ExtraSuggestionTextForSection(DialogSection section) const; | 331 string16 ExtraSuggestionTextForSection(DialogSection section) const; |
333 gfx::Image ExtraSuggestionIconForSection(DialogSection section) const; | 332 gfx::Image ExtraSuggestionIconForSection(DialogSection section) const; |
334 | 333 |
335 // Whether |section| should be showing an "Edit" link. | 334 // Whether |section| should be showing an "Edit" link. |
336 bool EditEnabledForSection(DialogSection section) const; | 335 bool EditEnabledForSection(DialogSection section) const; |
337 | 336 |
338 // Loads profiles that can suggest data for |type|. |field_contents| is the | 337 // Loads profiles that can suggest data for |type|. |field_contents| is the |
339 // part the user has already typed. |inputs| is the rest of section. | 338 // part the user has already typed. |inputs| is the rest of section. |
(...skipping 26 matching lines...) Expand all Loading... |
366 bool IsManuallyEditingAnySection() const; | 365 bool IsManuallyEditingAnySection() const; |
367 | 366 |
368 // Whether all of the input fields currently showing in the dialog have valid | 367 // Whether all of the input fields currently showing in the dialog have valid |
369 // contents. | 368 // contents. |
370 bool AllSectionsAreValid() const; | 369 bool AllSectionsAreValid() const; |
371 | 370 |
372 // Whether all of the input fields currently showing in the given |section| of | 371 // Whether all of the input fields currently showing in the given |section| of |
373 // the dialog have valid contents. | 372 // the dialog have valid contents. |
374 bool SectionIsValid(DialogSection section) const; | 373 bool SectionIsValid(DialogSection section) const; |
375 | 374 |
376 // Returns true if |key| refers to a suggestion, as opposed to some control | |
377 // menu item. | |
378 bool IsASuggestionItemKey(const std::string& key); | |
379 | |
380 // Whether the billing section should be used to fill in the shipping details. | 375 // Whether the billing section should be used to fill in the shipping details. |
381 bool ShouldUseBillingForShipping(); | 376 bool ShouldUseBillingForShipping(); |
382 | 377 |
383 // Whether the user wishes to save information locally to Autofill. | 378 // Whether the user wishes to save information locally to Autofill. |
384 bool ShouldSaveDetailsLocally(); | 379 bool ShouldSaveDetailsLocally(); |
385 | 380 |
386 // Change whether the controller is currently submitting details to Autofill | 381 // Change whether the controller is currently submitting details to Autofill |
387 // or Online Wallet (|is_submitting_|) and update the view. | 382 // or Online Wallet (|is_submitting_|) and update the view. |
388 void SetIsSubmitting(bool submitting); | 383 void SetIsSubmitting(bool submitting); |
389 | 384 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 | 524 |
530 // Whether or not there was an error in the Autocheckout flow. | 525 // Whether or not there was an error in the Autocheckout flow. |
531 bool had_autocheckout_error_; | 526 bool had_autocheckout_error_; |
532 | 527 |
533 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); | 528 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); |
534 }; | 529 }; |
535 | 530 |
536 } // namespace autofill | 531 } // namespace autofill |
537 | 532 |
538 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 533 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
OLD | NEW |