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 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 public wallet::WalletSigninHelperDelegate, | 77 public wallet::WalletSigninHelperDelegate, |
78 public PersonalDataManagerObserver, | 78 public PersonalDataManagerObserver, |
79 public AccountChooserModelDelegate { | 79 public AccountChooserModelDelegate { |
80 public: | 80 public: |
81 virtual ~AutofillDialogControllerImpl(); | 81 virtual ~AutofillDialogControllerImpl(); |
82 | 82 |
83 static base::WeakPtr<AutofillDialogControllerImpl> Create( | 83 static base::WeakPtr<AutofillDialogControllerImpl> Create( |
84 content::WebContents* contents, | 84 content::WebContents* contents, |
85 const FormData& form_structure, | 85 const FormData& form_structure, |
86 const GURL& source_url, | 86 const GURL& source_url, |
87 const DialogType dialog_type, | |
88 const base::Callback<void(const FormStructure*, | 87 const base::Callback<void(const FormStructure*, |
89 const std::string&)>& callback); | 88 const std::string&)>& callback); |
90 | 89 |
91 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 90 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
92 | 91 |
93 // AutofillDialogController implementation. | 92 // AutofillDialogController implementation. |
94 virtual void Show() OVERRIDE; | 93 virtual void Show() OVERRIDE; |
95 virtual void Hide() OVERRIDE; | 94 virtual void Hide() OVERRIDE; |
96 virtual void TabActivated() OVERRIDE; | 95 virtual void TabActivated() OVERRIDE; |
97 | 96 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 virtual void Observe(int type, | 177 virtual void Observe(int type, |
179 const content::NotificationSource& source, | 178 const content::NotificationSource& source, |
180 const content::NotificationDetails& details) OVERRIDE; | 179 const content::NotificationDetails& details) OVERRIDE; |
181 | 180 |
182 // SuggestionsMenuModelDelegate implementation. | 181 // SuggestionsMenuModelDelegate implementation. |
183 virtual void SuggestionItemSelected(SuggestionsMenuModel* model, | 182 virtual void SuggestionItemSelected(SuggestionsMenuModel* model, |
184 size_t index) OVERRIDE; | 183 size_t index) OVERRIDE; |
185 | 184 |
186 // wallet::WalletClientDelegate implementation. | 185 // wallet::WalletClientDelegate implementation. |
187 virtual const AutofillMetrics& GetMetricLogger() const OVERRIDE; | 186 virtual const AutofillMetrics& GetMetricLogger() const OVERRIDE; |
188 virtual DialogType GetDialogType() const OVERRIDE; | |
189 virtual std::string GetRiskData() const OVERRIDE; | 187 virtual std::string GetRiskData() const OVERRIDE; |
190 virtual std::string GetWalletCookieValue() const OVERRIDE; | 188 virtual std::string GetWalletCookieValue() const OVERRIDE; |
191 virtual bool IsShippingAddressRequired() const OVERRIDE; | 189 virtual bool IsShippingAddressRequired() const OVERRIDE; |
192 virtual void OnDidAcceptLegalDocuments() OVERRIDE; | 190 virtual void OnDidAcceptLegalDocuments() OVERRIDE; |
193 virtual void OnDidAuthenticateInstrument(bool success) OVERRIDE; | 191 virtual void OnDidAuthenticateInstrument(bool success) OVERRIDE; |
194 virtual void OnDidGetFullWallet( | 192 virtual void OnDidGetFullWallet( |
195 scoped_ptr<wallet::FullWallet> full_wallet) OVERRIDE; | 193 scoped_ptr<wallet::FullWallet> full_wallet) OVERRIDE; |
196 virtual void OnDidGetWalletItems( | 194 virtual void OnDidGetWalletItems( |
197 scoped_ptr<wallet::WalletItems> wallet_items) OVERRIDE; | 195 scoped_ptr<wallet::WalletItems> wallet_items) OVERRIDE; |
198 virtual void OnDidSaveToWallet( | 196 virtual void OnDidSaveToWallet( |
(...skipping 14 matching lines...) Expand all Loading... |
213 // wallet::WalletSigninHelperDelegate implementation. | 211 // wallet::WalletSigninHelperDelegate implementation. |
214 virtual void OnPassiveSigninSuccess(const std::string& username) OVERRIDE; | 212 virtual void OnPassiveSigninSuccess(const std::string& username) OVERRIDE; |
215 virtual void OnPassiveSigninFailure( | 213 virtual void OnPassiveSigninFailure( |
216 const GoogleServiceAuthError& error) OVERRIDE; | 214 const GoogleServiceAuthError& error) OVERRIDE; |
217 virtual void OnUserNameFetchSuccess(const std::string& username) OVERRIDE; | 215 virtual void OnUserNameFetchSuccess(const std::string& username) OVERRIDE; |
218 virtual void OnUserNameFetchFailure( | 216 virtual void OnUserNameFetchFailure( |
219 const GoogleServiceAuthError& error) OVERRIDE; | 217 const GoogleServiceAuthError& error) OVERRIDE; |
220 virtual void OnDidFetchWalletCookieValue( | 218 virtual void OnDidFetchWalletCookieValue( |
221 const std::string& cookie_value) OVERRIDE; | 219 const std::string& cookie_value) OVERRIDE; |
222 | 220 |
223 DialogType dialog_type() const { return dialog_type_; } | |
224 | |
225 protected: | 221 protected: |
226 // Exposed for testing. | 222 // Exposed for testing. |
227 AutofillDialogControllerImpl( | 223 AutofillDialogControllerImpl( |
228 content::WebContents* contents, | 224 content::WebContents* contents, |
229 const FormData& form_structure, | 225 const FormData& form_structure, |
230 const GURL& source_url, | 226 const GURL& source_url, |
231 const DialogType dialog_type, | |
232 const base::Callback<void(const FormStructure*, | 227 const base::Callback<void(const FormStructure*, |
233 const std::string&)>& callback); | 228 const std::string&)>& callback); |
234 | 229 |
235 // Exposed for testing. | 230 // Exposed for testing. |
236 AutofillDialogView* view() { return view_.get(); } | 231 AutofillDialogView* view() { return view_.get(); } |
237 virtual AutofillDialogView* CreateView(); | 232 virtual AutofillDialogView* CreateView(); |
238 const DetailInput* input_showing_popup() const { | 233 const DetailInput* input_showing_popup() const { |
239 return input_showing_popup_; | 234 return input_showing_popup_; |
240 } | 235 } |
241 | 236 |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 void MaybeShowCreditCardBubble(); | 542 void MaybeShowCreditCardBubble(); |
548 | 543 |
549 // The |profile| for |contents_|. | 544 // The |profile| for |contents_|. |
550 Profile* const profile_; | 545 Profile* const profile_; |
551 | 546 |
552 // For logging UMA metrics. | 547 // For logging UMA metrics. |
553 const AutofillMetrics metric_logger_; | 548 const AutofillMetrics metric_logger_; |
554 base::Time dialog_shown_timestamp_; | 549 base::Time dialog_shown_timestamp_; |
555 AutofillMetrics::DialogInitialUserStateMetric initial_user_state_; | 550 AutofillMetrics::DialogInitialUserStateMetric initial_user_state_; |
556 | 551 |
557 // Whether this is an Autocheckout or a requestAutocomplete dialog. | |
558 const DialogType dialog_type_; | |
559 | |
560 FormStructure form_structure_; | 552 FormStructure form_structure_; |
561 | 553 |
562 // Whether the URL visible to the user when this dialog was requested to be | 554 // Whether the URL visible to the user when this dialog was requested to be |
563 // invoked is the same as |source_url_|. | 555 // invoked is the same as |source_url_|. |
564 bool invoked_from_same_origin_; | 556 bool invoked_from_same_origin_; |
565 | 557 |
566 // The URL of the invoking site. | 558 // The URL of the invoking site. |
567 GURL source_url_; | 559 GURL source_url_; |
568 | 560 |
569 // The callback via which we return the collected data and, if Online Wallet | 561 // The callback via which we return the collected data and, if Online Wallet |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 // show a bubble as the dialog closes to confirm a user's new card info was | 691 // show a bubble as the dialog closes to confirm a user's new card info was |
700 // saved. Never populated while incognito (as nothing's actually saved). | 692 // saved. Never populated while incognito (as nothing's actually saved). |
701 scoped_ptr<CreditCard> newly_saved_card_; | 693 scoped_ptr<CreditCard> newly_saved_card_; |
702 | 694 |
703 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); | 695 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); |
704 }; | 696 }; |
705 | 697 |
706 } // namespace autofill | 698 } // namespace autofill |
707 | 699 |
708 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 700 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
OLD | NEW |