| 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 "components/password_manager/core/common/credential_manager_types.h" | 10 #include "components/password_manager/core/common/credential_manager_types.h" |
| 11 #include "components/password_manager/core/common/password_manager_ui.h" | 11 #include "components/password_manager/core/common/password_manager_ui.h" |
| 12 | 12 |
| 13 namespace autofill { | 13 namespace autofill { |
| 14 struct PasswordForm; | 14 struct PasswordForm; |
| 15 } | 15 } |
| 16 namespace content { | 16 namespace content { |
| 17 class WebContents; | 17 class WebContents; |
| 18 } | 18 } |
| 19 namespace password_manager { | 19 namespace password_manager { |
| 20 struct InteractionsStats; | 20 struct InteractionsStats; |
| 21 } | 21 } |
| 22 class GURL; | 22 class GURL; |
| 23 | 23 |
| 24 // An interface for ManagePasswordsBubbleModel implemented by | 24 // An interface for ManagePasswordsBubbleModel implemented by |
| 25 // ManagePasswordsUIController. Allows to retrieve the current state of the tab | 25 // ManagePasswordsUIController. Allows to retrieve the current state of the tab |
| 26 // and notify about user actions. | 26 // and notify about user actions. |
| 27 class PasswordsModelDelegate { | 27 class PasswordsModelDelegate { |
| 28 public: | 28 public: |
| 29 // Returns the origin of the current page. | 29 // Returns the URL of the site the current forms are retrieved for. |
| 30 virtual const GURL& GetOrigin() const = 0; | 30 virtual const GURL& GetOrigin() const = 0; |
| 31 | 31 |
| 32 // Returns the current tab state. | 32 // Returns the current tab state. |
| 33 virtual password_manager::ui::State GetState() const = 0; | 33 virtual password_manager::ui::State GetState() const = 0; |
| 34 | 34 |
| 35 // Returns the pending password in PENDING_PASSWORD_STATE and | 35 // Returns the pending password in PENDING_PASSWORD_STATE and |
| 36 // PENDING_PASSWORD_UPDATE_STATE, the saved password in CONFIRMATION_STATE, | 36 // PENDING_PASSWORD_UPDATE_STATE, the saved password in CONFIRMATION_STATE, |
| 37 // the returned credential in AUTO_SIGNIN_STATE. | 37 // the returned credential in AUTO_SIGNIN_STATE. |
| 38 virtual const autofill::PasswordForm& GetPendingPassword() const = 0; | 38 virtual const autofill::PasswordForm& GetPendingPassword() const = 0; |
| 39 | 39 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 protected: | 95 protected: |
| 96 virtual ~PasswordsModelDelegate() = default; | 96 virtual ~PasswordsModelDelegate() = default; |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 // Returns ManagePasswordsUIController instance for |contents| | 99 // Returns ManagePasswordsUIController instance for |contents| |
| 100 PasswordsModelDelegate* PasswordsModelDelegateFromWebContents( | 100 PasswordsModelDelegate* PasswordsModelDelegateFromWebContents( |
| 101 content::WebContents* web_contents); | 101 content::WebContents* web_contents); |
| 102 | 102 |
| 103 #endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORDS_MODEL_DELEGATE_H_ | 103 #endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORDS_MODEL_DELEGATE_H_ |
| OLD | NEW |