| 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" | |
| 12 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 13 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 15 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 16 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 17 #include "chrome/browser/ui/autofill/account_chooser_model.h" | 16 #include "chrome/browser/ui/autofill/account_chooser_model.h" |
| 18 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" | 17 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" |
| 19 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" | 18 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" |
| 20 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" | 19 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" |
| 21 #include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.h" | 20 #include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 public AccountChooserModelDelegate, | 80 public AccountChooserModelDelegate, |
| 82 public gfx::AnimationDelegate, | 81 public gfx::AnimationDelegate, |
| 83 public ::i18n::addressinput::LoadRulesDelegate { | 82 public ::i18n::addressinput::LoadRulesDelegate { |
| 84 public: | 83 public: |
| 85 virtual ~AutofillDialogControllerImpl(); | 84 virtual ~AutofillDialogControllerImpl(); |
| 86 | 85 |
| 87 static base::WeakPtr<AutofillDialogControllerImpl> Create( | 86 static base::WeakPtr<AutofillDialogControllerImpl> Create( |
| 88 content::WebContents* contents, | 87 content::WebContents* contents, |
| 89 const FormData& form_structure, | 88 const FormData& form_structure, |
| 90 const GURL& source_url, | 89 const GURL& source_url, |
| 91 const base::Callback<void(const FormStructure*)>& callback); | 90 const AutofillManagerDelegate::ResultCallback& callback); |
| 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 |
| 98 // AutofillDialogViewDelegate implementation. | 97 // AutofillDialogViewDelegate implementation. |
| 99 virtual base::string16 DialogTitle() const OVERRIDE; | 98 virtual base::string16 DialogTitle() const OVERRIDE; |
| 100 virtual base::string16 AccountChooserText() const OVERRIDE; | 99 virtual base::string16 AccountChooserText() const OVERRIDE; |
| 101 virtual base::string16 SignInLinkText() const OVERRIDE; | 100 virtual base::string16 SignInLinkText() const OVERRIDE; |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 REQUIRES_PASSIVE_SIGN_IN, | 232 REQUIRES_PASSIVE_SIGN_IN, |
| 234 SIGNED_IN, | 233 SIGNED_IN, |
| 235 SIGN_IN_DISABLED, | 234 SIGN_IN_DISABLED, |
| 236 }; | 235 }; |
| 237 | 236 |
| 238 // Exposed for testing. | 237 // Exposed for testing. |
| 239 AutofillDialogControllerImpl( | 238 AutofillDialogControllerImpl( |
| 240 content::WebContents* contents, | 239 content::WebContents* contents, |
| 241 const FormData& form_structure, | 240 const FormData& form_structure, |
| 242 const GURL& source_url, | 241 const GURL& source_url, |
| 243 const base::Callback<void(const FormStructure*)>& callback); | 242 const AutofillManagerDelegate::ResultCallback& callback); |
| 244 | 243 |
| 245 // Exposed for testing. | 244 // Exposed for testing. |
| 246 AutofillDialogView* view() { return view_.get(); } | 245 AutofillDialogView* view() { return view_.get(); } |
| 247 virtual AutofillDialogView* CreateView(); | 246 virtual AutofillDialogView* CreateView(); |
| 248 ServerFieldType popup_input_type() const { | 247 ServerFieldType popup_input_type() const { |
| 249 return popup_input_type_; | 248 return popup_input_type_; |
| 250 } | 249 } |
| 251 | 250 |
| 252 // Returns the PersonalDataManager for |profile_|. | 251 // Returns the PersonalDataManager for |profile_|. |
| 253 virtual PersonalDataManager* GetManager() const; | 252 virtual PersonalDataManager* GetManager() const; |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 FormStructure form_structure_; | 622 FormStructure form_structure_; |
| 624 | 623 |
| 625 // Whether the URL visible to the user when this dialog was requested to be | 624 // Whether the URL visible to the user when this dialog was requested to be |
| 626 // invoked is the same as |source_url_|. | 625 // invoked is the same as |source_url_|. |
| 627 bool invoked_from_same_origin_; | 626 bool invoked_from_same_origin_; |
| 628 | 627 |
| 629 // The URL of the invoking site. | 628 // The URL of the invoking site. |
| 630 GURL source_url_; | 629 GURL source_url_; |
| 631 | 630 |
| 632 // The callback via which we return the collected data. | 631 // The callback via which we return the collected data. |
| 633 base::Callback<void(const FormStructure*)> callback_; | 632 AutofillManagerDelegate::ResultCallback callback_; |
| 634 | 633 |
| 635 // The AccountChooserModel acts as the MenuModel for the account chooser, | 634 // The AccountChooserModel acts as the MenuModel for the account chooser, |
| 636 // and also tracks which data source the dialog is using. | 635 // and also tracks which data source the dialog is using. |
| 637 scoped_ptr<AccountChooserModel> account_chooser_model_; | 636 scoped_ptr<AccountChooserModel> account_chooser_model_; |
| 638 | 637 |
| 639 // The sign-in helper to fetch the user's Wallet cookie and to perform passive | 638 // The sign-in helper to fetch the user's Wallet cookie and to perform passive |
| 640 // sign-in. The helper is set only during fetch/sign-in, and NULL otherwise. | 639 // sign-in. The helper is set only during fetch/sign-in, and NULL otherwise. |
| 641 scoped_ptr<wallet::WalletSigninHelper> signin_helper_; | 640 scoped_ptr<wallet::WalletSigninHelper> signin_helper_; |
| 642 | 641 |
| 643 // A client to talk to the Online Wallet API. | 642 // A client to talk to the Online Wallet API. |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 base::string16 submitted_cardholder_name_; | 813 base::string16 submitted_cardholder_name_; |
| 815 | 814 |
| 816 base::WeakPtrFactory<AutofillDialogControllerImpl> weak_ptr_factory_; | 815 base::WeakPtrFactory<AutofillDialogControllerImpl> weak_ptr_factory_; |
| 817 | 816 |
| 818 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); | 817 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); |
| 819 }; | 818 }; |
| 820 | 819 |
| 821 } // namespace autofill | 820 } // namespace autofill |
| 822 | 821 |
| 823 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 822 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
| OLD | NEW |