| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_PASSWORDS_MODEL_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_PASSWORDS_PASSWORDS_MODEL_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_UI_PASSWORDS_PASSWORDS_MODEL_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_PASSWORDS_PASSWORDS_MODEL_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "components/password_manager/core/common/credential_manager_types.h" | 11 #include "components/password_manager/core/common/credential_manager_types.h" |
| 12 #include "components/password_manager/core/common/password_manager_ui.h" | 12 #include "components/password_manager/core/common/password_manager_ui.h" |
| 13 | 13 |
| 14 namespace autofill { | 14 namespace autofill { |
| 15 struct PasswordForm; | 15 struct PasswordForm; |
| 16 } | 16 } |
| 17 namespace content { | 17 namespace content { |
| 18 class WebContents; | 18 class WebContents; |
| 19 } | 19 } |
| 20 namespace password_manager { | 20 namespace password_manager { |
| 21 struct InteractionsStats; | 21 struct InteractionsStats; |
| 22 } | 22 } |
| 23 class DesktopIOSPromotion; |
| 23 class GURL; | 24 class GURL; |
| 24 | 25 |
| 25 // An interface for ManagePasswordsBubbleModel implemented by | 26 // An interface for ManagePasswordsBubbleModel implemented by |
| 26 // ManagePasswordsUIController. Allows to retrieve the current state of the tab | 27 // ManagePasswordsUIController. Allows to retrieve the current state of the tab |
| 27 // and notify about user actions. | 28 // and notify about user actions. |
| 28 class PasswordsModelDelegate { | 29 class PasswordsModelDelegate { |
| 29 public: | 30 public: |
| 30 // Returns WebContents* the model is attached to. | 31 // Returns WebContents* the model is attached to. |
| 31 virtual content::WebContents* GetWebContents() const = 0; | 32 virtual content::WebContents* GetWebContents() const = 0; |
| 32 | 33 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 75 |
| 75 // Called from the model when the user chooses to update a password. | 76 // Called from the model when the user chooses to update a password. |
| 76 virtual void UpdatePassword(const autofill::PasswordForm& password_form) = 0; | 77 virtual void UpdatePassword(const autofill::PasswordForm& password_form) = 0; |
| 77 | 78 |
| 78 // Called from the dialog controller when the user chooses a credential. | 79 // Called from the dialog controller when the user chooses a credential. |
| 79 // Controller can be destroyed inside the method. | 80 // Controller can be destroyed inside the method. |
| 80 virtual void ChooseCredential( | 81 virtual void ChooseCredential( |
| 81 const autofill::PasswordForm& form, | 82 const autofill::PasswordForm& form, |
| 82 password_manager::CredentialType credential_type) = 0; | 83 password_manager::CredentialType credential_type) = 0; |
| 83 | 84 |
| 85 // Returns the DesktopIOSPromotionBubble. |
| 86 virtual DesktopIOSPromotion* GetDesktopIOSPromotion() = 0; |
| 87 |
| 84 // Open a new tab, pointing to the Smart Lock help article. | 88 // Open a new tab, pointing to the Smart Lock help article. |
| 85 virtual void NavigateToSmartLockHelpPage() = 0; | 89 virtual void NavigateToSmartLockHelpPage() = 0; |
| 86 // Open a new tab, pointing to the password manager settings page. | 90 // Open a new tab, pointing to the password manager settings page. |
| 87 virtual void NavigateToPasswordManagerSettingsPage() = 0; | 91 virtual void NavigateToPasswordManagerSettingsPage() = 0; |
| 88 // Starts the Chrome Sign in flow. | 92 // Starts the Chrome Sign in flow. |
| 89 virtual void NavigateToChromeSignIn() = 0; | 93 virtual void NavigateToChromeSignIn() = 0; |
| 90 | 94 |
| 91 // Called from the dialog controller when the dialog is hidden. | 95 // Called from the dialog controller when the dialog is hidden. |
| 92 virtual void OnDialogHidden() = 0; | 96 virtual void OnDialogHidden() = 0; |
| 93 | 97 |
| 94 protected: | 98 protected: |
| 95 virtual ~PasswordsModelDelegate() = default; | 99 virtual ~PasswordsModelDelegate() = default; |
| 96 }; | 100 }; |
| 97 | 101 |
| 98 base::WeakPtr<PasswordsModelDelegate> | 102 base::WeakPtr<PasswordsModelDelegate> |
| 99 PasswordsModelDelegateFromWebContents(content::WebContents* web_contents); | 103 PasswordsModelDelegateFromWebContents(content::WebContents* web_contents); |
| 100 | 104 |
| 101 #endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORDS_MODEL_DELEGATE_H_ | 105 #endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORDS_MODEL_DELEGATE_H_ |
| OLD | NEW |