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/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.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_types.h" | 19 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" |
20 #include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.h" | 20 #include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.h" |
21 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" | 21 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" |
22 #include "chrome/browser/ui/autofill/country_combobox_model.h" | 22 #include "chrome/browser/ui/autofill/country_combobox_model.h" |
23 #include "components/autofill/content/browser/wallet/wallet_client.h" | 23 #include "components/autofill/content/browser/wallet/wallet_client.h" |
24 #include "components/autofill/content/browser/wallet/wallet_client_delegate.h" | 24 #include "components/autofill/content/browser/wallet/wallet_client_delegate.h" |
25 #include "components/autofill/content/browser/wallet/wallet_items.h" | 25 #include "components/autofill/content/browser/wallet/wallet_items.h" |
26 #include "components/autofill/content/browser/wallet/wallet_signin_helper_delega
te.h" | 26 #include "components/autofill/content/browser/wallet/wallet_signin_helper_delega
te.h" |
27 #include "components/autofill/core/browser/autofill_manager_delegate.h" | 27 #include "components/autofill/core/browser/autofill_client.h" |
28 #include "components/autofill/core/browser/autofill_metrics.h" | 28 #include "components/autofill/core/browser/autofill_metrics.h" |
29 #include "components/autofill/core/browser/autofill_popup_delegate.h" | 29 #include "components/autofill/core/browser/autofill_popup_delegate.h" |
30 #include "components/autofill/core/browser/field_types.h" | 30 #include "components/autofill/core/browser/field_types.h" |
31 #include "components/autofill/core/browser/form_structure.h" | 31 #include "components/autofill/core/browser/form_structure.h" |
32 #include "components/autofill/core/browser/personal_data_manager.h" | 32 #include "components/autofill/core/browser/personal_data_manager.h" |
33 #include "components/autofill/core/browser/personal_data_manager_observer.h" | 33 #include "components/autofill/core/browser/personal_data_manager_observer.h" |
34 #include "content/public/browser/notification_observer.h" | 34 #include "content/public/browser/notification_observer.h" |
35 #include "content/public/browser/notification_registrar.h" | 35 #include "content/public/browser/notification_registrar.h" |
36 #include "content/public/browser/web_contents_observer.h" | 36 #include "content/public/browser/web_contents_observer.h" |
37 #include "content/public/common/ssl_status.h" | 37 #include "content/public/common/ssl_status.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 public AccountChooserModelDelegate, | 80 public AccountChooserModelDelegate, |
81 public gfx::AnimationDelegate, | 81 public gfx::AnimationDelegate, |
82 public ::i18n::addressinput::LoadRulesDelegate { | 82 public ::i18n::addressinput::LoadRulesDelegate { |
83 public: | 83 public: |
84 virtual ~AutofillDialogControllerImpl(); | 84 virtual ~AutofillDialogControllerImpl(); |
85 | 85 |
86 static base::WeakPtr<AutofillDialogControllerImpl> Create( | 86 static base::WeakPtr<AutofillDialogControllerImpl> Create( |
87 content::WebContents* contents, | 87 content::WebContents* contents, |
88 const FormData& form_structure, | 88 const FormData& form_structure, |
89 const GURL& source_url, | 89 const GURL& source_url, |
90 const AutofillManagerDelegate::ResultCallback& callback); | 90 const AutofillClient::ResultCallback& callback); |
91 | 91 |
92 // AutofillDialogController implementation. | 92 // AutofillDialogController implementation. |
93 virtual void Show() OVERRIDE; | 93 virtual void Show() OVERRIDE; |
94 virtual void Hide() OVERRIDE; | 94 virtual void Hide() OVERRIDE; |
95 virtual void TabActivated() OVERRIDE; | 95 virtual void TabActivated() OVERRIDE; |
96 | 96 |
97 // AutofillDialogViewDelegate implementation. | 97 // AutofillDialogViewDelegate implementation. |
98 virtual base::string16 DialogTitle() const OVERRIDE; | 98 virtual base::string16 DialogTitle() const OVERRIDE; |
99 virtual base::string16 AccountChooserText() const OVERRIDE; | 99 virtual base::string16 AccountChooserText() const OVERRIDE; |
100 virtual base::string16 SignInLinkText() const OVERRIDE; | 100 virtual base::string16 SignInLinkText() const OVERRIDE; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 enum DialogSignedInState { | 226 enum DialogSignedInState { |
227 NOT_CHECKED, | 227 NOT_CHECKED, |
228 REQUIRES_RESPONSE, | 228 REQUIRES_RESPONSE, |
229 REQUIRES_SIGN_IN, | 229 REQUIRES_SIGN_IN, |
230 REQUIRES_PASSIVE_SIGN_IN, | 230 REQUIRES_PASSIVE_SIGN_IN, |
231 SIGNED_IN, | 231 SIGNED_IN, |
232 SIGN_IN_DISABLED, | 232 SIGN_IN_DISABLED, |
233 }; | 233 }; |
234 | 234 |
235 // Exposed for testing. | 235 // Exposed for testing. |
236 AutofillDialogControllerImpl( | 236 AutofillDialogControllerImpl(content::WebContents* contents, |
237 content::WebContents* contents, | 237 const FormData& form_structure, |
238 const FormData& form_structure, | 238 const GURL& source_url, |
239 const GURL& source_url, | 239 const AutofillClient::ResultCallback& callback); |
240 const AutofillManagerDelegate::ResultCallback& callback); | |
241 | 240 |
242 // Exposed for testing. | 241 // Exposed for testing. |
243 AutofillDialogView* view() { return view_.get(); } | 242 AutofillDialogView* view() { return view_.get(); } |
244 virtual AutofillDialogView* CreateView(); | 243 virtual AutofillDialogView* CreateView(); |
245 ServerFieldType popup_input_type() const { | 244 ServerFieldType popup_input_type() const { |
246 return popup_input_type_; | 245 return popup_input_type_; |
247 } | 246 } |
248 | 247 |
249 // Returns the PersonalDataManager for |profile_|. | 248 // Returns the PersonalDataManager for |profile_|. |
250 virtual PersonalDataManager* GetManager() const; | 249 virtual PersonalDataManager* GetManager() const; |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 FormStructure form_structure_; | 632 FormStructure form_structure_; |
634 | 633 |
635 // Whether the URL visible to the user when this dialog was requested to be | 634 // Whether the URL visible to the user when this dialog was requested to be |
636 // invoked is the same as |source_url_|. | 635 // invoked is the same as |source_url_|. |
637 bool invoked_from_same_origin_; | 636 bool invoked_from_same_origin_; |
638 | 637 |
639 // The URL of the invoking site. | 638 // The URL of the invoking site. |
640 GURL source_url_; | 639 GURL source_url_; |
641 | 640 |
642 // The callback via which we return the collected data. | 641 // The callback via which we return the collected data. |
643 AutofillManagerDelegate::ResultCallback callback_; | 642 AutofillClient::ResultCallback callback_; |
644 | 643 |
645 // The AccountChooserModel acts as the MenuModel for the account chooser, | 644 // The AccountChooserModel acts as the MenuModel for the account chooser, |
646 // and also tracks which data source the dialog is using. | 645 // and also tracks which data source the dialog is using. |
647 scoped_ptr<AccountChooserModel> account_chooser_model_; | 646 scoped_ptr<AccountChooserModel> account_chooser_model_; |
648 | 647 |
649 // The sign-in helper to fetch the user's Wallet cookie and to perform passive | 648 // The sign-in helper to fetch the user's Wallet cookie and to perform passive |
650 // sign-in. The helper is set only during fetch/sign-in, and NULL otherwise. | 649 // sign-in. The helper is set only during fetch/sign-in, and NULL otherwise. |
651 scoped_ptr<wallet::WalletSigninHelper> signin_helper_; | 650 scoped_ptr<wallet::WalletSigninHelper> signin_helper_; |
652 | 651 |
653 // A client to talk to the Online Wallet API. | 652 // A client to talk to the Online Wallet API. |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 base::string16 submitted_cardholder_name_; | 831 base::string16 submitted_cardholder_name_; |
833 | 832 |
834 base::WeakPtrFactory<AutofillDialogControllerImpl> weak_ptr_factory_; | 833 base::WeakPtrFactory<AutofillDialogControllerImpl> weak_ptr_factory_; |
835 | 834 |
836 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); | 835 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); |
837 }; | 836 }; |
838 | 837 |
839 } // namespace autofill | 838 } // namespace autofill |
840 | 839 |
841 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 840 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
OLD | NEW |