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 |
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/strings/string16.h" | 14 #include "base/strings/string16.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 #include "chrome/browser/ui/autofill/account_chooser_model.h" | 16 #include "chrome/browser/ui/autofill/account_chooser_model.h" |
17 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" | 17 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" |
18 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" | 18 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" |
| 19 #include "chrome/browser/ui/autofill/autofill_dialog_tab_manager_delegate.h" |
19 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" | 20 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" |
20 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" | 21 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" |
21 #include "chrome/browser/ui/autofill/country_combobox_model.h" | 22 #include "chrome/browser/ui/autofill/country_combobox_model.h" |
22 #include "components/autofill/content/browser/autocheckout_steps.h" | 23 #include "components/autofill/content/browser/autocheckout_steps.h" |
23 #include "components/autofill/content/browser/wallet/wallet_client.h" | 24 #include "components/autofill/content/browser/wallet/wallet_client.h" |
24 #include "components/autofill/content/browser/wallet/wallet_client_delegate.h" | 25 #include "components/autofill/content/browser/wallet/wallet_client_delegate.h" |
25 #include "components/autofill/content/browser/wallet/wallet_items.h" | 26 #include "components/autofill/content/browser/wallet/wallet_items.h" |
26 #include "components/autofill/content/browser/wallet/wallet_signin_helper_delega
te.h" | 27 #include "components/autofill/content/browser/wallet/wallet_signin_helper_delega
te.h" |
27 #include "components/autofill/core/browser/autofill_manager_delegate.h" | 28 #include "components/autofill/core/browser/autofill_manager_delegate.h" |
28 #include "components/autofill/core/browser/autofill_metrics.h" | 29 #include "components/autofill/core/browser/autofill_metrics.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 class Fingerprint; | 62 class Fingerprint; |
62 } | 63 } |
63 | 64 |
64 namespace wallet { | 65 namespace wallet { |
65 class WalletSigninHelper; | 66 class WalletSigninHelper; |
66 } | 67 } |
67 | 68 |
68 // This class drives the dialog that appears when a site uses the imperative | 69 // This class drives the dialog that appears when a site uses the imperative |
69 // autocomplete API to fill out a form. | 70 // autocomplete API to fill out a form. |
70 class AutofillDialogControllerImpl : public AutofillDialogController, | 71 class AutofillDialogControllerImpl : public AutofillDialogController, |
| 72 public AutofillDialogTabManagerDelegate, |
71 public AutofillPopupDelegate, | 73 public AutofillPopupDelegate, |
72 public content::NotificationObserver, | 74 public content::NotificationObserver, |
73 public content::WebContentsObserver, | 75 public content::WebContentsObserver, |
74 public SuggestionsMenuModelDelegate, | 76 public SuggestionsMenuModelDelegate, |
75 public wallet::WalletClientDelegate, | 77 public wallet::WalletClientDelegate, |
76 public wallet::WalletSigninHelperDelegate, | 78 public wallet::WalletSigninHelperDelegate, |
77 public PersonalDataManagerObserver, | 79 public PersonalDataManagerObserver, |
78 public AccountChooserModelDelegate { | 80 public AccountChooserModelDelegate { |
79 public: | 81 public: |
80 virtual ~AutofillDialogControllerImpl(); | 82 virtual ~AutofillDialogControllerImpl(); |
81 | 83 |
82 static base::WeakPtr<AutofillDialogControllerImpl> Create( | 84 static base::WeakPtr<AutofillDialogTabManagerDelegate> Create( |
83 content::WebContents* contents, | 85 content::WebContents* contents, |
84 const FormData& form_structure, | 86 const FormData& form_structure, |
85 const GURL& source_url, | 87 const GURL& source_url, |
86 const DialogType dialog_type, | 88 const DialogType dialog_type, |
87 const base::Callback<void(const FormStructure*, | 89 const base::Callback<void(const FormStructure*, |
88 const std::string&)>& callback); | 90 const std::string&)>& callback); |
89 | 91 |
90 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 92 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
91 | 93 |
92 void Show(); | 94 virtual void Show() OVERRIDE; |
93 void Hide(); | 95 virtual void Hide() OVERRIDE; |
94 | 96 |
95 // Called when the tab hosting this dialog is activated by a user gesture. | 97 // Called when the tab hosting this dialog is activated by a user gesture. |
96 // Used to trigger a refresh of the user's Wallet data. | 98 // Used to trigger a refresh of the user's Wallet data. |
97 void TabActivated(); | 99 virtual void TabActivated() OVERRIDE; |
98 | 100 |
99 // Adds a step in the flow to the Autocheckout UI. | 101 // Adds a step in the flow to the Autocheckout UI. |
100 void AddAutocheckoutStep(AutocheckoutStepType step_type); | 102 virtual void AddAutocheckoutStep(AutocheckoutStepType step_type) OVERRIDE; |
101 | 103 |
102 // Updates the status of a step in the Autocheckout UI. | 104 // Updates the status of a step in the Autocheckout UI. |
103 void UpdateAutocheckoutStep(AutocheckoutStepType step_type, | 105 virtual void UpdateAutocheckoutStep( |
104 AutocheckoutStepStatus step_status); | 106 AutocheckoutStepType step_type, |
| 107 AutocheckoutStepStatus step_status) OVERRIDE; |
105 | 108 |
106 // Called when there is an error in an active Autocheckout flow. | 109 // Called when there is an error in an active Autocheckout flow. |
107 void OnAutocheckoutError(); | 110 virtual void OnAutocheckoutError() OVERRIDE; |
108 | 111 |
109 // Called when an Autocheckout flow completes successfully. | 112 // Called when an Autocheckout flow completes successfully. |
110 void OnAutocheckoutSuccess(); | 113 virtual void OnAutocheckoutSuccess() OVERRIDE; |
111 | 114 |
112 // Returns |view_| as a testable version of itself (if |view_| exists and | 115 // Returns |view_| as a testable version of itself (if |view_| exists and |
113 // actually implements |AutofillDialogView::GetTestableView()|). | 116 // actually implements |AutofillDialogView::GetTestableView()|). |
114 TestableAutofillDialogView* GetTestableView(); | 117 TestableAutofillDialogView* GetTestableView(); |
115 | 118 |
116 // AutofillDialogController implementation. | 119 // AutofillDialogController implementation. |
117 virtual string16 DialogTitle() const OVERRIDE; | 120 virtual string16 DialogTitle() const OVERRIDE; |
118 virtual string16 AccountChooserText() const OVERRIDE; | 121 virtual string16 AccountChooserText() const OVERRIDE; |
119 virtual string16 SignInLinkText() const OVERRIDE; | 122 virtual string16 SignInLinkText() const OVERRIDE; |
120 virtual string16 EditSuggestionText() const OVERRIDE; | 123 virtual string16 EditSuggestionText() const OVERRIDE; |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 // show a bubble as the dialog closes to confirm a user's new card info was | 725 // show a bubble as the dialog closes to confirm a user's new card info was |
723 // saved. Never populated while incognito (as nothing's actually saved). | 726 // saved. Never populated while incognito (as nothing's actually saved). |
724 scoped_ptr<CreditCard> newly_saved_card_; | 727 scoped_ptr<CreditCard> newly_saved_card_; |
725 | 728 |
726 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); | 729 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); |
727 }; | 730 }; |
728 | 731 |
729 } // namespace autofill | 732 } // namespace autofill |
730 | 733 |
731 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 734 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
OLD | NEW |