Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(362)

Side by Side Diff: chrome/browser/ui/autofill/autofill_dialog_controller_impl.h

Issue 22623002: Extract AutofillDialogController interface and common utilities. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_models.h" 18 #include "chrome/browser/ui/autofill/autofill_dialog_models.h"
18 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" 19 #include "chrome/browser/ui/autofill/autofill_dialog_types.h"
19 #include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.h" 20 #include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.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"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 class Fingerprint; 61 class Fingerprint;
61 } 62 }
62 63
63 namespace wallet { 64 namespace wallet {
64 class WalletSigninHelper; 65 class WalletSigninHelper;
65 } 66 }
66 67
67 // This class drives the dialog that appears when a site uses the imperative 68 // This class drives the dialog that appears when a site uses the imperative
68 // autocomplete API to fill out a form. 69 // autocomplete API to fill out a form.
69 class AutofillDialogControllerImpl : public AutofillDialogViewDelegate, 70 class AutofillDialogControllerImpl : public AutofillDialogViewDelegate,
71 public AutofillDialogController,
70 public AutofillPopupDelegate, 72 public AutofillPopupDelegate,
71 public content::NotificationObserver, 73 public content::NotificationObserver,
72 public SuggestionsMenuModelDelegate, 74 public SuggestionsMenuModelDelegate,
73 public wallet::WalletClientDelegate, 75 public wallet::WalletClientDelegate,
74 public wallet::WalletSigninHelperDelegate, 76 public wallet::WalletSigninHelperDelegate,
75 public PersonalDataManagerObserver, 77 public PersonalDataManagerObserver,
76 public AccountChooserModelDelegate { 78 public AccountChooserModelDelegate {
77 public: 79 public:
78 virtual ~AutofillDialogControllerImpl(); 80 virtual ~AutofillDialogControllerImpl();
79 81
80 static base::WeakPtr<AutofillDialogControllerImpl> Create( 82 static base::WeakPtr<AutofillDialogController> Create(
81 content::WebContents* contents, 83 content::WebContents* contents,
82 const FormData& form_structure, 84 const FormData& form_structure,
83 const GURL& source_url, 85 const GURL& source_url,
84 const DialogType dialog_type, 86 const DialogType dialog_type,
85 const base::Callback<void(const FormStructure*, 87 const base::Callback<void(const FormStructure*,
86 const std::string&)>& callback); 88 const std::string&)>& callback);
87 89
88 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); 90 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
89 91
90 void Show(); 92 virtual void Show() OVERRIDE;
91 void Hide(); 93 virtual void Hide() OVERRIDE;
92 94
93 // Called when the tab hosting this dialog is activated by a user gesture. 95 // Called when the tab hosting this dialog is activated by a user gesture.
aruslan 2013/08/07 21:07:00 Remove descriptions, condense the overrides. Add "
aruslan 2013/08/07 21:21:23 Done.
94 // Used to trigger a refresh of the user's Wallet data. 96 // Used to trigger a refresh of the user's Wallet data.
95 void TabActivated(); 97 virtual void TabActivated() OVERRIDE;
96 98
97 // Adds a step in the flow to the Autocheckout UI. 99 // Adds a step in the flow to the Autocheckout UI.
98 void AddAutocheckoutStep(AutocheckoutStepType step_type); 100 virtual void AddAutocheckoutStep(AutocheckoutStepType step_type) OVERRIDE;
99 101
100 // Updates the status of a step in the Autocheckout UI. 102 // Updates the status of a step in the Autocheckout UI.
101 void UpdateAutocheckoutStep(AutocheckoutStepType step_type, 103 virtual void UpdateAutocheckoutStep(
102 AutocheckoutStepStatus step_status); 104 AutocheckoutStepType step_type,
105 AutocheckoutStepStatus step_status) OVERRIDE;
103 106
104 // Called when there is an error in an active Autocheckout flow. 107 // Called when there is an error in an active Autocheckout flow.
105 void OnAutocheckoutError(); 108 virtual void OnAutocheckoutError() OVERRIDE;
106 109
107 // Called when an Autocheckout flow completes successfully. 110 // Called when an Autocheckout flow completes successfully.
108 void OnAutocheckoutSuccess(); 111 virtual void OnAutocheckoutSuccess() OVERRIDE;
109 112
110 // Returns |view_| as a testable version of itself (if |view_| exists and 113 // Returns |view_| as a testable version of itself (if |view_| exists and
111 // actually implements |AutofillDialogView::GetTestableView()|). 114 // actually implements |AutofillDialogView::GetTestableView()|).
112 TestableAutofillDialogView* GetTestableView(); 115 TestableAutofillDialogView* GetTestableView();
113 116
114 // AutofillDialogViewDelegate implementation. 117 // AutofillDialogViewDelegate implementation.
115 virtual string16 DialogTitle() const OVERRIDE; 118 virtual string16 DialogTitle() const OVERRIDE;
116 virtual string16 AccountChooserText() const OVERRIDE; 119 virtual string16 AccountChooserText() const OVERRIDE;
117 virtual string16 SignInLinkText() const OVERRIDE; 120 virtual string16 SignInLinkText() const OVERRIDE;
118 virtual string16 EditSuggestionText() const OVERRIDE; 121 virtual string16 EditSuggestionText() const OVERRIDE;
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 // show a bubble as the dialog closes to confirm a user's new card info was 716 // show a bubble as the dialog closes to confirm a user's new card info was
714 // saved. Never populated while incognito (as nothing's actually saved). 717 // saved. Never populated while incognito (as nothing's actually saved).
715 scoped_ptr<CreditCard> newly_saved_card_; 718 scoped_ptr<CreditCard> newly_saved_card_;
716 719
717 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); 720 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl);
718 }; 721 };
719 722
720 } // namespace autofill 723 } // namespace autofill
721 724
722 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ 725 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698