Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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* CreateDesktopIOSPromotion() 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 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 | 169 |
| 167 // content::WebContentsObserver: | 170 // content::WebContentsObserver: |
| 168 void WebContentsDestroyed() override; | 171 void WebContentsDestroyed() override; |
| 169 | 172 |
| 170 // The wrapper around current state and data. | 173 // The wrapper around current state and data. |
| 171 ManagePasswordsState passwords_data_; | 174 ManagePasswordsState passwords_data_; |
| 172 | 175 |
| 173 // The controller for the blocking dialogs. | 176 // The controller for the blocking dialogs. |
| 174 std::unique_ptr<PasswordDialogControllerImpl> dialog_controller_; | 177 std::unique_ptr<PasswordDialogControllerImpl> dialog_controller_; |
| 175 | 178 |
| 179 // The controller for the desktop ios promotion. | |
| 180 std::unique_ptr<DesktopIOSPromotionController> ios_promotion_controller_; | |
|
vasilii
2017/02/17 12:59:14
This shouldn't be here. Move it to ManagePasswords
mrefaat
2017/02/17 14:13:49
Done.
| |
| 181 | |
| 176 BubbleStatus bubble_status_; | 182 BubbleStatus bubble_status_; |
| 177 | 183 |
| 178 // The bubbles of different types can pop up unpredictably superseding each | 184 // The bubbles of different types can pop up unpredictably superseding each |
| 179 // other. However, closing the bubble may affect the state of | 185 // other. However, closing the bubble may affect the state of |
| 180 // ManagePasswordsUIController internally. This is undesired if | 186 // ManagePasswordsUIController internally. This is undesired if |
| 181 // ManagePasswordsUIController is in the process of opening a new bubble. The | 187 // ManagePasswordsUIController is in the process of opening a new bubble. The |
| 182 // situation is worse on Windows where the bubble is destroyed asynchronously. | 188 // 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 | 189 // Thus, OnBubbleHidden() can be called after the new one is shown. By that |
| 184 // time the internal state of ManagePasswordsUIController has nothing to do | 190 // time the internal state of ManagePasswordsUIController has nothing to do |
| 185 // with the old bubble. | 191 // with the old bubble. |
| 186 // Invalidating all the weak pointers will detach the current bubble. | 192 // Invalidating all the weak pointers will detach the current bubble. |
| 187 base::WeakPtrFactory<ManagePasswordsUIController> weak_ptr_factory_; | 193 base::WeakPtrFactory<ManagePasswordsUIController> weak_ptr_factory_; |
| 188 | 194 |
| 189 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsUIController); | 195 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsUIController); |
| 190 }; | 196 }; |
| 191 | 197 |
| 192 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_ | 198 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_ |
| OLD | NEW |