| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 REQUIRES_PASSIVE_SIGN_IN, | 233 REQUIRES_PASSIVE_SIGN_IN, |
| 235 SIGNED_IN, | 234 SIGNED_IN, |
| 236 SIGN_IN_DISABLED, | 235 SIGN_IN_DISABLED, |
| 237 }; | 236 }; |
| 238 | 237 |
| 239 // Exposed for testing. | 238 // Exposed for testing. |
| 240 AutofillDialogControllerImpl( | 239 AutofillDialogControllerImpl( |
| 241 content::WebContents* contents, | 240 content::WebContents* contents, |
| 242 const FormData& form_structure, | 241 const FormData& form_structure, |
| 243 const GURL& source_url, | 242 const GURL& source_url, |
| 244 const base::Callback<void(const FormStructure*)>& callback); | 243 const AutofillManagerDelegate::ResultCallback& callback); |
| 245 | 244 |
| 246 // Exposed for testing. | 245 // Exposed for testing. |
| 247 AutofillDialogView* view() { return view_.get(); } | 246 AutofillDialogView* view() { return view_.get(); } |
| 248 virtual AutofillDialogView* CreateView(); | 247 virtual AutofillDialogView* CreateView(); |
| 249 ServerFieldType popup_input_type() const { | 248 ServerFieldType popup_input_type() const { |
| 250 return popup_input_type_; | 249 return popup_input_type_; |
| 251 } | 250 } |
| 252 | 251 |
| 253 // Returns the PersonalDataManager for |profile_|. | 252 // Returns the PersonalDataManager for |profile_|. |
| 254 virtual PersonalDataManager* GetManager() const; | 253 virtual PersonalDataManager* GetManager() const; |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 FormStructure form_structure_; | 623 FormStructure form_structure_; |
| 625 | 624 |
| 626 // Whether the URL visible to the user when this dialog was requested to be | 625 // Whether the URL visible to the user when this dialog was requested to be |
| 627 // invoked is the same as |source_url_|. | 626 // invoked is the same as |source_url_|. |
| 628 bool invoked_from_same_origin_; | 627 bool invoked_from_same_origin_; |
| 629 | 628 |
| 630 // The URL of the invoking site. | 629 // The URL of the invoking site. |
| 631 GURL source_url_; | 630 GURL source_url_; |
| 632 | 631 |
| 633 // The callback via which we return the collected data. | 632 // The callback via which we return the collected data. |
| 634 base::Callback<void(const FormStructure*)> callback_; | 633 AutofillManagerDelegate::ResultCallback callback_; |
| 635 | 634 |
| 636 // The AccountChooserModel acts as the MenuModel for the account chooser, | 635 // The AccountChooserModel acts as the MenuModel for the account chooser, |
| 637 // and also tracks which data source the dialog is using. | 636 // and also tracks which data source the dialog is using. |
| 638 scoped_ptr<AccountChooserModel> account_chooser_model_; | 637 scoped_ptr<AccountChooserModel> account_chooser_model_; |
| 639 | 638 |
| 640 // The sign-in helper to fetch the user's Wallet cookie and to perform passive | 639 // The sign-in helper to fetch the user's Wallet cookie and to perform passive |
| 641 // sign-in. The helper is set only during fetch/sign-in, and NULL otherwise. | 640 // sign-in. The helper is set only during fetch/sign-in, and NULL otherwise. |
| 642 scoped_ptr<wallet::WalletSigninHelper> signin_helper_; | 641 scoped_ptr<wallet::WalletSigninHelper> signin_helper_; |
| 643 | 642 |
| 644 // A client to talk to the Online Wallet API. | 643 // A client to talk to the Online Wallet API. |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 base::string16 submitted_cardholder_name_; | 814 base::string16 submitted_cardholder_name_; |
| 816 | 815 |
| 817 base::WeakPtrFactory<AutofillDialogControllerImpl> weak_ptr_factory_; | 816 base::WeakPtrFactory<AutofillDialogControllerImpl> weak_ptr_factory_; |
| 818 | 817 |
| 819 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); | 818 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); |
| 820 }; | 819 }; |
| 821 | 820 |
| 822 } // namespace autofill | 821 } // namespace autofill |
| 823 | 822 |
| 824 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 823 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
| OLD | NEW |