| 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_CLIENT_UI_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_PASSWORDS_PASSWORDS_CLIENT_UI_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_UI_PASSWORDS_PASSWORDS_CLIENT_UI_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_PASSWORDS_PASSWORDS_CLIENT_UI_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 virtual void OnPasswordSubmitted( | 32 virtual void OnPasswordSubmitted( |
| 33 std::unique_ptr<password_manager::PasswordFormManager> form_manager) = 0; | 33 std::unique_ptr<password_manager::PasswordFormManager> form_manager) = 0; |
| 34 | 34 |
| 35 // Called when the user submits a new password for an existing credential. | 35 // Called when the user submits a new password for an existing credential. |
| 36 // This stores the provided object and triggers the UI to prompt the user | 36 // This stores the provided object and triggers the UI to prompt the user |
| 37 // about whether they would like to update the password. | 37 // about whether they would like to update the password. |
| 38 virtual void OnUpdatePasswordSubmitted( | 38 virtual void OnUpdatePasswordSubmitted( |
| 39 std::unique_ptr<password_manager::PasswordFormManager> form_manager) = 0; | 39 std::unique_ptr<password_manager::PasswordFormManager> form_manager) = 0; |
| 40 | 40 |
| 41 // Called when the site asks user to choose from credentials. This triggers | 41 // Called when the site asks user to choose from credentials. This triggers |
| 42 // the UI to prompt the user. |local_credentials| and |federated_credentials| | 42 // the UI to prompt the user. |local_credentials| shouldn't be empty. |origin| |
| 43 // shouldn't both be empty. |origin| is a URL of the site that requested a | 43 // is a URL of the site that requested a credential. |
| 44 // credential. | |
| 45 // Returns true when the UI is shown. |callback| is called when the user made | 44 // Returns true when the UI is shown. |callback| is called when the user made |
| 46 // a decision. If the UI isn't shown the method returns false and doesn't call | 45 // a decision. If the UI isn't shown the method returns false and doesn't call |
| 47 // |callback|. | 46 // |callback|. |
| 48 virtual bool OnChooseCredentials( | 47 virtual bool OnChooseCredentials( |
| 49 std::vector<std::unique_ptr<autofill::PasswordForm>> local_credentials, | 48 std::vector<std::unique_ptr<autofill::PasswordForm>> local_credentials, |
| 50 std::vector<std::unique_ptr<autofill::PasswordForm>> | |
| 51 federated_credentials, | |
| 52 const GURL& origin, | 49 const GURL& origin, |
| 53 const base::Callback<void(const autofill::PasswordForm*)>& callback) = 0; | 50 const base::Callback<void(const autofill::PasswordForm*)>& callback) = 0; |
| 54 | 51 |
| 55 // Called when user is auto signed in to the site. |local_forms[0]| contains | 52 // Called when user is auto signed in to the site. |local_forms[0]| contains |
| 56 // the credential returned to the site. |origin| is a URL of the site. | 53 // the credential returned to the site. |origin| is a URL of the site. |
| 57 virtual void OnAutoSignin( | 54 virtual void OnAutoSignin( |
| 58 std::vector<std::unique_ptr<autofill::PasswordForm>> local_forms, | 55 std::vector<std::unique_ptr<autofill::PasswordForm>> local_forms, |
| 59 const GURL& origin) = 0; | 56 const GURL& origin) = 0; |
| 60 | 57 |
| 61 // Called when it's the right time to enable autosign-in explicitly. | 58 // Called when it's the right time to enable autosign-in explicitly. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 79 | 76 |
| 80 protected: | 77 protected: |
| 81 virtual ~PasswordsClientUIDelegate() = default; | 78 virtual ~PasswordsClientUIDelegate() = default; |
| 82 }; | 79 }; |
| 83 | 80 |
| 84 // Returns ManagePasswordsUIController instance for |contents| | 81 // Returns ManagePasswordsUIController instance for |contents| |
| 85 PasswordsClientUIDelegate* PasswordsClientUIDelegateFromWebContents( | 82 PasswordsClientUIDelegate* PasswordsClientUIDelegateFromWebContents( |
| 86 content::WebContents* web_contents); | 83 content::WebContents* web_contents); |
| 87 | 84 |
| 88 #endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORDS_CLIENT_UI_DELEGATE_H_ | 85 #endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORDS_CLIENT_UI_DELEGATE_H_ |
| OLD | NEW |