| 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 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/string16.h" | 14 #include "base/string16.h" |
| 15 #include "base/time.h" | 15 #include "base/time.h" |
| 16 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" | 16 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" |
| 17 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" | 17 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" |
| 18 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" | 18 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" |
| 19 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" | 19 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" |
| 20 #include "chrome/browser/ui/autofill/country_combobox_model.h" | 20 #include "chrome/browser/ui/autofill/country_combobox_model.h" |
| 21 #include "components/autofill/browser/autofill_manager_delegate.h" | 21 #include "components/autofill/browser/autofill_manager_delegate.h" |
| 22 #include "components/autofill/browser/autofill_metrics.h" | 22 #include "components/autofill/browser/autofill_metrics.h" |
| 23 #include "components/autofill/browser/autofill_popup_delegate.h" | 23 #include "components/autofill/browser/autofill_popup_delegate.h" |
| 24 #include "components/autofill/browser/field_types.h" | 24 #include "components/autofill/browser/field_types.h" |
| 25 #include "components/autofill/browser/form_structure.h" | 25 #include "components/autofill/browser/form_structure.h" |
| 26 #include "components/autofill/browser/personal_data_manager.h" | 26 #include "components/autofill/browser/personal_data_manager.h" |
| 27 #include "components/autofill/browser/personal_data_manager_observer.h" | 27 #include "components/autofill/browser/personal_data_manager_observer.h" |
| 28 #include "components/autofill/browser/wallet/required_action.h" | |
| 29 #include "components/autofill/browser/wallet/wallet_client.h" | 28 #include "components/autofill/browser/wallet/wallet_client.h" |
| 30 #include "components/autofill/browser/wallet/wallet_client_delegate.h" | 29 #include "components/autofill/browser/wallet/wallet_client_delegate.h" |
| 31 #include "content/public/browser/notification_observer.h" | 30 #include "content/public/browser/notification_observer.h" |
| 32 #include "content/public/browser/notification_registrar.h" | 31 #include "content/public/browser/notification_registrar.h" |
| 33 #include "content/public/common/ssl_status.h" | 32 #include "content/public/common/ssl_status.h" |
| 34 #include "googleurl/src/gurl.h" | 33 #include "googleurl/src/gurl.h" |
| 35 #include "ui/base/models/simple_menu_model.h" | 34 #include "ui/base/models/simple_menu_model.h" |
| 36 #include "ui/base/ui_base_types.h" | 35 #include "ui/base/ui_base_types.h" |
| 37 | 36 |
| 38 class AutofillPopupControllerImpl; | 37 class AutofillPopupControllerImpl; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 virtual string16 SaveLocallyText() const OVERRIDE; | 94 virtual string16 SaveLocallyText() const OVERRIDE; |
| 96 virtual string16 CancelSignInText() const OVERRIDE; | 95 virtual string16 CancelSignInText() const OVERRIDE; |
| 97 virtual string16 ProgressBarText() const OVERRIDE; | 96 virtual string16 ProgressBarText() const OVERRIDE; |
| 98 virtual DialogSignedInState SignedInState() const OVERRIDE; | 97 virtual DialogSignedInState SignedInState() const OVERRIDE; |
| 99 virtual bool ShouldOfferToSaveInChrome() const OVERRIDE; | 98 virtual bool ShouldOfferToSaveInChrome() const OVERRIDE; |
| 100 virtual ui::MenuModel* MenuModelForAccountChooser() OVERRIDE; | 99 virtual ui::MenuModel* MenuModelForAccountChooser() OVERRIDE; |
| 101 virtual gfx::Image AccountChooserImage() OVERRIDE; | 100 virtual gfx::Image AccountChooserImage() OVERRIDE; |
| 102 virtual bool AutocheckoutIsRunning() const OVERRIDE; | 101 virtual bool AutocheckoutIsRunning() const OVERRIDE; |
| 103 virtual bool HadAutocheckoutError() const OVERRIDE; | 102 virtual bool HadAutocheckoutError() const OVERRIDE; |
| 104 virtual bool IsDialogButtonEnabled(ui::DialogButton button) const OVERRIDE; | 103 virtual bool IsDialogButtonEnabled(ui::DialogButton button) const OVERRIDE; |
| 104 virtual bool IsSubmitPausedOn(wallet::RequiredAction action) const OVERRIDE; |
| 105 virtual bool SectionIsActive(DialogSection section) const OVERRIDE; | 105 virtual bool SectionIsActive(DialogSection section) const OVERRIDE; |
| 106 virtual const DetailInputs& RequestedFieldsForSection(DialogSection section) | 106 virtual const DetailInputs& RequestedFieldsForSection(DialogSection section) |
| 107 const OVERRIDE; | 107 const OVERRIDE; |
| 108 virtual ui::ComboboxModel* ComboboxModelForAutofillType( | 108 virtual ui::ComboboxModel* ComboboxModelForAutofillType( |
| 109 AutofillFieldType type) OVERRIDE; | 109 AutofillFieldType type) OVERRIDE; |
| 110 virtual ui::MenuModel* MenuModelForSection(DialogSection section) OVERRIDE; | 110 virtual ui::MenuModel* MenuModelForSection(DialogSection section) OVERRIDE; |
| 111 virtual string16 LabelForSection(DialogSection section) const OVERRIDE; | 111 virtual string16 LabelForSection(DialogSection section) const OVERRIDE; |
| 112 virtual string16 SuggestionTextForSection(DialogSection section) OVERRIDE; | 112 virtual string16 SuggestionTextForSection(DialogSection section) OVERRIDE; |
| 113 virtual gfx::Image SuggestionIconForSection(DialogSection section) OVERRIDE; | 113 virtual gfx::Image SuggestionIconForSection(DialogSection section) OVERRIDE; |
| 114 virtual void EditClickedForSection(DialogSection section) OVERRIDE; | 114 virtual void EditClickedForSection(DialogSection section) OVERRIDE; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 125 const string16& field_contents, | 125 const string16& field_contents, |
| 126 bool was_edit) OVERRIDE; | 126 bool was_edit) OVERRIDE; |
| 127 virtual bool HandleKeyPressEventInInput( | 127 virtual bool HandleKeyPressEventInInput( |
| 128 const content::NativeWebKeyboardEvent& event) OVERRIDE; | 128 const content::NativeWebKeyboardEvent& event) OVERRIDE; |
| 129 virtual void FocusMoved() OVERRIDE; | 129 virtual void FocusMoved() OVERRIDE; |
| 130 virtual void ViewClosed() OVERRIDE; | 130 virtual void ViewClosed() OVERRIDE; |
| 131 virtual std::vector<DialogNotification> CurrentNotifications() const OVERRIDE; | 131 virtual std::vector<DialogNotification> CurrentNotifications() const OVERRIDE; |
| 132 virtual void StartSignInFlow() OVERRIDE; | 132 virtual void StartSignInFlow() OVERRIDE; |
| 133 virtual void EndSignInFlow() OVERRIDE; | 133 virtual void EndSignInFlow() OVERRIDE; |
| 134 virtual void OnCancel() OVERRIDE; | 134 virtual void OnCancel() OVERRIDE; |
| 135 virtual void OnSubmit() OVERRIDE; | 135 virtual void OnAccept() OVERRIDE; |
| 136 virtual Profile* profile() OVERRIDE; | 136 virtual Profile* profile() OVERRIDE; |
| 137 virtual content::WebContents* web_contents() OVERRIDE; | 137 virtual content::WebContents* web_contents() OVERRIDE; |
| 138 | 138 |
| 139 // AutofillPopupDelegate implementation. | 139 // AutofillPopupDelegate implementation. |
| 140 virtual void OnPopupShown(content::KeyboardListener* listener) OVERRIDE; | 140 virtual void OnPopupShown(content::KeyboardListener* listener) OVERRIDE; |
| 141 virtual void OnPopupHidden(content::KeyboardListener* listener) OVERRIDE; | 141 virtual void OnPopupHidden(content::KeyboardListener* listener) OVERRIDE; |
| 142 virtual void DidSelectSuggestion(int identifier) OVERRIDE; | 142 virtual void DidSelectSuggestion(int identifier) OVERRIDE; |
| 143 virtual void DidAcceptSuggestion(const string16& value, | 143 virtual void DidAcceptSuggestion(const string16& value, |
| 144 int identifier) OVERRIDE; | 144 int identifier) OVERRIDE; |
| 145 virtual void RemoveSuggestion(const string16& value, | 145 virtual void RemoveSuggestion(const string16& value, |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 | 258 |
| 259 // Sets the CVC result on |form_structure_| to the value in |cvc|. | 259 // Sets the CVC result on |form_structure_| to the value in |cvc|. |
| 260 void SetCvcResult(const string16& cvc); | 260 void SetCvcResult(const string16& cvc); |
| 261 | 261 |
| 262 // Gets the SuggestionsMenuModel for |section|. | 262 // Gets the SuggestionsMenuModel for |section|. |
| 263 SuggestionsMenuModel* SuggestionsMenuModelForSection(DialogSection section); | 263 SuggestionsMenuModel* SuggestionsMenuModelForSection(DialogSection section); |
| 264 // And the reverse. | 264 // And the reverse. |
| 265 DialogSection SectionForSuggestionsMenuModel( | 265 DialogSection SectionForSuggestionsMenuModel( |
| 266 const SuggestionsMenuModel& model); | 266 const SuggestionsMenuModel& model); |
| 267 | 267 |
| 268 // Suggested text for a section in the middle of processing a required action. |
| 269 string16 RequiredActionSuggestionTextForSection(DialogSection section); |
| 270 |
| 268 // Loads profiles that can suggest data for |type|. |field_contents| is the | 271 // Loads profiles that can suggest data for |type|. |field_contents| is the |
| 269 // part the user has already typed. |inputs| is the rest of section. | 272 // part the user has already typed. |inputs| is the rest of section. |
| 270 // Identifying info is loaded into the last three outparams as well as | 273 // Identifying info is loaded into the last three outparams as well as |
| 271 // |popup_guids_|. | 274 // |popup_guids_|. |
| 272 void GetProfileSuggestions( | 275 void GetProfileSuggestions( |
| 273 AutofillFieldType type, | 276 AutofillFieldType type, |
| 274 const string16& field_contents, | 277 const string16& field_contents, |
| 275 const DetailInputs& inputs, | 278 const DetailInputs& inputs, |
| 276 std::vector<string16>* popup_values, | 279 std::vector<string16>* popup_values, |
| 277 std::vector<string16>* popup_labels, | 280 std::vector<string16>* popup_labels, |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 | 397 |
| 395 // For logging UMA metrics. | 398 // For logging UMA metrics. |
| 396 const AutofillMetrics& metric_logger_; | 399 const AutofillMetrics& metric_logger_; |
| 397 base::Time dialog_shown_timestamp_; | 400 base::Time dialog_shown_timestamp_; |
| 398 base::Time autocheckout_started_timestamp_; | 401 base::Time autocheckout_started_timestamp_; |
| 399 AutofillMetrics::DialogInitialUserStateMetric initial_user_state_; | 402 AutofillMetrics::DialogInitialUserStateMetric initial_user_state_; |
| 400 | 403 |
| 401 // Whether this is an Autocheckout or a requestAutocomplete dialog. | 404 // Whether this is an Autocheckout or a requestAutocomplete dialog. |
| 402 const DialogType dialog_type_; | 405 const DialogType dialog_type_; |
| 403 | 406 |
| 404 // True if the termination action was a submit. | 407 // True after the user first accepts the dialog and presses "Submit". May |
| 405 bool did_submit_; | 408 // continue to be true while process required actions. |
| 409 bool is_submitting_; |
| 406 | 410 |
| 407 // Whether or not an Autocheckout flow is running. | 411 // Whether or not an Autocheckout flow is running. |
| 408 bool autocheckout_is_running_; | 412 bool autocheckout_is_running_; |
| 409 | 413 |
| 410 // Whether or not there was an error in the Autocheckout flow. | 414 // Whether or not there was an error in the Autocheckout flow. |
| 411 bool had_autocheckout_error_; | 415 bool had_autocheckout_error_; |
| 412 | 416 |
| 413 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); | 417 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); |
| 414 }; | 418 }; |
| 415 | 419 |
| 416 } // namespace autofill | 420 } // namespace autofill |
| 417 | 421 |
| 418 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 422 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
| OLD | NEW |