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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 virtual string16 ConfirmButtonText() const OVERRIDE; | 100 virtual string16 ConfirmButtonText() const OVERRIDE; |
101 virtual string16 SaveLocallyText() const OVERRIDE; | 101 virtual string16 SaveLocallyText() const OVERRIDE; |
102 virtual string16 CancelSignInText() const OVERRIDE; | 102 virtual string16 CancelSignInText() const OVERRIDE; |
103 virtual string16 ProgressBarText() const OVERRIDE; | 103 virtual string16 ProgressBarText() const OVERRIDE; |
104 virtual string16 LegalDocumentsText() OVERRIDE; | 104 virtual string16 LegalDocumentsText() OVERRIDE; |
105 virtual DialogSignedInState SignedInState() const OVERRIDE; | 105 virtual DialogSignedInState SignedInState() const OVERRIDE; |
106 virtual bool ShouldShowSpinner() const OVERRIDE; | 106 virtual bool ShouldShowSpinner() const OVERRIDE; |
107 virtual bool ShouldOfferToSaveInChrome() const OVERRIDE; | 107 virtual bool ShouldOfferToSaveInChrome() const OVERRIDE; |
108 virtual ui::MenuModel* MenuModelForAccountChooser() OVERRIDE; | 108 virtual ui::MenuModel* MenuModelForAccountChooser() OVERRIDE; |
109 virtual gfx::Image AccountChooserImage() OVERRIDE; | 109 virtual gfx::Image AccountChooserImage() OVERRIDE; |
| 110 virtual bool GetPayWithoutWallet() const OVERRIDE; |
| 111 virtual void SetPayWithoutWallet(bool pay_without_wallet) OVERRIDE; |
110 virtual bool AutocheckoutIsRunning() const OVERRIDE; | 112 virtual bool AutocheckoutIsRunning() const OVERRIDE; |
111 virtual bool HadAutocheckoutError() const OVERRIDE; | 113 virtual bool HadAutocheckoutError() const OVERRIDE; |
112 virtual bool IsDialogButtonEnabled(ui::DialogButton button) const OVERRIDE; | 114 virtual bool IsDialogButtonEnabled(ui::DialogButton button) const OVERRIDE; |
113 virtual const std::vector<ui::Range>& LegalDocumentLinks() OVERRIDE; | 115 virtual const std::vector<ui::Range>& LegalDocumentLinks() OVERRIDE; |
114 virtual bool SectionIsActive(DialogSection section) const OVERRIDE; | 116 virtual bool SectionIsActive(DialogSection section) const OVERRIDE; |
115 virtual const DetailInputs& RequestedFieldsForSection(DialogSection section) | 117 virtual const DetailInputs& RequestedFieldsForSection(DialogSection section) |
116 const OVERRIDE; | 118 const OVERRIDE; |
117 virtual ui::ComboboxModel* ComboboxModelForAutofillType( | 119 virtual ui::ComboboxModel* ComboboxModelForAutofillType( |
118 AutofillFieldType type) OVERRIDE; | 120 AutofillFieldType type) OVERRIDE; |
119 virtual ui::MenuModel* MenuModelForSection(DialogSection section) OVERRIDE; | 121 virtual ui::MenuModel* MenuModelForSection(DialogSection section) OVERRIDE; |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 void GenerateSuggestionsModels(); | 255 void GenerateSuggestionsModels(); |
254 | 256 |
255 // Returns whether |profile| is complete, i.e. can fill out all the relevant | 257 // Returns whether |profile| is complete, i.e. can fill out all the relevant |
256 // address info. Incomplete profiles will not be displayed in the dropdown | 258 // address info. Incomplete profiles will not be displayed in the dropdown |
257 // menu. | 259 // menu. |
258 bool IsCompleteProfile(const AutofillProfile& profile); | 260 bool IsCompleteProfile(const AutofillProfile& profile); |
259 | 261 |
260 // Whether the user's wallet items have at least one address and instrument. | 262 // Whether the user's wallet items have at least one address and instrument. |
261 bool HasCompleteWallet() const; | 263 bool HasCompleteWallet() const; |
262 | 264 |
263 // Starts fetching the wallet items. | 265 // Starts fetching the wallet items from Online Wallet. |
264 void StartFetchingWalletItems(); | 266 void GetWalletItems(); |
265 | 267 |
266 // Refreshes the model on Wallet or sign-in state update. | 268 // Refreshes the model on Wallet or sign-in state update. |
267 void OnWalletOrSigninUpdate(); | 269 void OnWalletOrSigninUpdate(); |
268 | 270 |
269 // Should be called on the Wallet sign-in error. | 271 // Should be called on the Wallet sign-in error. |
270 void OnWalletSigninError(); | 272 void OnWalletSigninError(); |
271 | 273 |
272 // Calculates |legal_documents_text_| and |legal_document_link_ranges_| if | 274 // Calculates |legal_documents_text_| and |legal_document_link_ranges_| if |
273 // they have not already been calculated. | 275 // they have not already been calculated. |
274 void EnsureLegalDocumentsText(); | 276 void EnsureLegalDocumentsText(); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 | 465 |
464 // For logging UMA metrics. | 466 // For logging UMA metrics. |
465 const AutofillMetrics& metric_logger_; | 467 const AutofillMetrics& metric_logger_; |
466 base::Time dialog_shown_timestamp_; | 468 base::Time dialog_shown_timestamp_; |
467 base::Time autocheckout_started_timestamp_; | 469 base::Time autocheckout_started_timestamp_; |
468 AutofillMetrics::DialogInitialUserStateMetric initial_user_state_; | 470 AutofillMetrics::DialogInitialUserStateMetric initial_user_state_; |
469 | 471 |
470 // Whether this is an Autocheckout or a requestAutocomplete dialog. | 472 // Whether this is an Autocheckout or a requestAutocomplete dialog. |
471 const DialogType dialog_type_; | 473 const DialogType dialog_type_; |
472 | 474 |
| 475 // Whether this is the first time this profile has seen the Autofill dialog. |
| 476 bool is_first_run_; |
| 477 |
473 // True after the user first accepts the dialog and presses "Submit". May | 478 // True after the user first accepts the dialog and presses "Submit". May |
474 // continue to be true while processing required actions. | 479 // continue to be true while processing required actions. |
475 bool is_submitting_; | 480 bool is_submitting_; |
476 | 481 |
477 // Whether or not an Autocheckout flow is running. | 482 // Whether or not an Autocheckout flow is running. |
478 bool autocheckout_is_running_; | 483 bool autocheckout_is_running_; |
479 | 484 |
480 // Whether or not there was an error in the Autocheckout flow. | 485 // Whether or not there was an error in the Autocheckout flow. |
481 bool had_autocheckout_error_; | 486 bool had_autocheckout_error_; |
482 | 487 |
483 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); | 488 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); |
484 }; | 489 }; |
485 | 490 |
486 } // namespace autofill | 491 } // namespace autofill |
487 | 492 |
488 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 493 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
OLD | NEW |