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

Side by Side Diff: chrome/browser/ui/passwords/manage_passwords_ui_controller.h

Issue 2694893002: Integrate SMS service with Desktop iOS promotion (Closed)
Patch Set: Addressing comments/Update phone number usage/Change view-controller relation/Pending tests Created 3 years, 10 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 11 matching lines...) Expand all
22 } 22 }
23 23
24 namespace password_manager { 24 namespace password_manager {
25 enum class CredentialType; 25 enum class CredentialType;
26 struct InteractionsStats; 26 struct InteractionsStats;
27 class PasswordFormManager; 27 class PasswordFormManager;
28 } 28 }
29 29
30 class AccountChooserPrompt; 30 class AccountChooserPrompt;
31 class AutoSigninFirstRunPrompt; 31 class AutoSigninFirstRunPrompt;
32 class DesktopIOSPromotion;
33 class DesktopIOSPromotionController;
32 class ManagePasswordsIconView; 34 class ManagePasswordsIconView;
33 class PasswordDialogController; 35 class PasswordDialogController;
34 class PasswordDialogControllerImpl; 36 class PasswordDialogControllerImpl;
35 37
36 // Per-tab class to control the Omnibox password icon and bubble. 38 // Per-tab class to control the Omnibox password icon and bubble.
37 class ManagePasswordsUIController 39 class ManagePasswordsUIController
38 : public content::WebContentsObserver, 40 : public content::WebContentsObserver,
39 public content::WebContentsUserData<ManagePasswordsUIController>, 41 public content::WebContentsUserData<ManagePasswordsUIController>,
40 public password_manager::PasswordStore::Observer, 42 public password_manager::PasswordStore::Observer,
41 public PasswordsModelDelegate, 43 public PasswordsModelDelegate,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 void OnBubbleShown() override; 97 void OnBubbleShown() override;
96 void OnBubbleHidden() override; 98 void OnBubbleHidden() override;
97 void OnNoInteraction() override; 99 void OnNoInteraction() override;
98 void OnNopeUpdateClicked() override; 100 void OnNopeUpdateClicked() override;
99 void NeverSavePassword() override; 101 void NeverSavePassword() override;
100 void SavePassword() override; 102 void SavePassword() override;
101 void UpdatePassword(const autofill::PasswordForm& password_form) override; 103 void UpdatePassword(const autofill::PasswordForm& password_form) override;
102 void ChooseCredential( 104 void ChooseCredential(
103 const autofill::PasswordForm& form, 105 const autofill::PasswordForm& form,
104 password_manager::CredentialType credential_type) override; 106 password_manager::CredentialType credential_type) override;
107 DesktopIOSPromotion* GetDesktopIOSPromotion() override;
105 void NavigateToSmartLockHelpPage() override; 108 void NavigateToSmartLockHelpPage() override;
106 void NavigateToPasswordManagerSettingsPage() override; 109 void NavigateToPasswordManagerSettingsPage() override;
107 void NavigateToChromeSignIn() override; 110 void NavigateToChromeSignIn() override;
108 void OnDialogHidden() override; 111 void OnDialogHidden() override;
109 112
110 protected: 113 protected:
111 explicit ManagePasswordsUIController( 114 explicit ManagePasswordsUIController(
112 content::WebContents* web_contents); 115 content::WebContents* web_contents);
113 116
114 // The pieces of saving and blacklisting passwords that interact with 117 // The pieces of saving and blacklisting passwords that interact with
115 // FormManager, split off into internal functions for testing/mocking. 118 // FormManager, split off into internal functions for testing/mocking.
116 virtual void SavePasswordInternal(); 119 virtual void SavePasswordInternal();
117 virtual void UpdatePasswordInternal( 120 virtual void UpdatePasswordInternal(
118 const autofill::PasswordForm& password_form); 121 const autofill::PasswordForm& password_form);
119 virtual void NeverSavePasswordInternal(); 122 virtual void NeverSavePasswordInternal();
120 123
121 // Called when a PasswordForm is autofilled, when a new PasswordForm is 124 // Called when a PasswordForm is autofilled, when a new PasswordForm is
122 // submitted, or when a navigation occurs to update the visibility of the 125 // submitted, or when a navigation occurs to update the visibility of the
123 // manage passwords icon and bubble. 126 // manage passwords icon and bubble.
124 virtual void UpdateBubbleAndIconVisibility(); 127 virtual void UpdateBubbleAndIconVisibility();
125 128
126 // Called to create the account chooser dialog. Mocked in tests. 129 // Called to create the account chooser dialog. Mocked in tests.
127 virtual AccountChooserPrompt* CreateAccountChooser( 130 virtual AccountChooserPrompt* CreateAccountChooser(
128 PasswordDialogController* controller); 131 PasswordDialogController* controller);
129 132
133 // Called to create the desktop to iOS promotion bubble.
134 virtual DesktopIOSPromotion* CreateDesktopIOSPromotion();
135
130 // Called to create the account chooser dialog. Mocked in tests. 136 // Called to create the account chooser dialog. Mocked in tests.
131 virtual AutoSigninFirstRunPrompt* CreateAutoSigninPrompt( 137 virtual AutoSigninFirstRunPrompt* CreateAutoSigninPrompt(
132 PasswordDialogController* controller); 138 PasswordDialogController* controller);
133 139
134 // Check if |web_contents()| is attached to some Browser. Mocked in tests. 140 // Check if |web_contents()| is attached to some Browser. Mocked in tests.
135 virtual bool HasBrowserWindow() const; 141 virtual bool HasBrowserWindow() const;
136 142
137 // Overwrites the client for |passwords_data_|. 143 // Overwrites the client for |passwords_data_|.
138 void set_client(password_manager::PasswordManagerClient* client) { 144 void set_client(password_manager::PasswordManagerClient* client) {
139 passwords_data_.set_client(client); 145 passwords_data_.set_client(client);
(...skipping 26 matching lines...) Expand all
166 172
167 // content::WebContentsObserver: 173 // content::WebContentsObserver:
168 void WebContentsDestroyed() override; 174 void WebContentsDestroyed() override;
169 175
170 // The wrapper around current state and data. 176 // The wrapper around current state and data.
171 ManagePasswordsState passwords_data_; 177 ManagePasswordsState passwords_data_;
172 178
173 // The controller for the blocking dialogs. 179 // The controller for the blocking dialogs.
174 std::unique_ptr<PasswordDialogControllerImpl> dialog_controller_; 180 std::unique_ptr<PasswordDialogControllerImpl> dialog_controller_;
175 181
182 // The controller for the desktop ios promotion.
183 std::unique_ptr<DesktopIOSPromotionController> ios_promotion_controller_;
184
176 BubbleStatus bubble_status_; 185 BubbleStatus bubble_status_;
177 186
178 // The bubbles of different types can pop up unpredictably superseding each 187 // The bubbles of different types can pop up unpredictably superseding each
179 // other. However, closing the bubble may affect the state of 188 // other. However, closing the bubble may affect the state of
180 // ManagePasswordsUIController internally. This is undesired if 189 // ManagePasswordsUIController internally. This is undesired if
181 // ManagePasswordsUIController is in the process of opening a new bubble. The 190 // ManagePasswordsUIController is in the process of opening a new bubble. The
182 // situation is worse on Windows where the bubble is destroyed asynchronously. 191 // situation is worse on Windows where the bubble is destroyed asynchronously.
183 // Thus, OnBubbleHidden() can be called after the new one is shown. By that 192 // Thus, OnBubbleHidden() can be called after the new one is shown. By that
184 // time the internal state of ManagePasswordsUIController has nothing to do 193 // time the internal state of ManagePasswordsUIController has nothing to do
185 // with the old bubble. 194 // with the old bubble.
186 // Invalidating all the weak pointers will detach the current bubble. 195 // Invalidating all the weak pointers will detach the current bubble.
187 base::WeakPtrFactory<ManagePasswordsUIController> weak_ptr_factory_; 196 base::WeakPtrFactory<ManagePasswordsUIController> weak_ptr_factory_;
188 197
189 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsUIController); 198 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsUIController);
190 }; 199 };
191 200
192 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_ 201 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698