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 COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_CLIENT_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_CLIENT_H_ |
6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_CLIENT_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_CLIENT_H_ |
7 | 7 |
8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
9 #include "components/autofill/core/common/password_form.h" | 9 #include "components/autofill/core/common/password_form.h" |
10 #include "components/autofill/core/common/password_form_fill_data.h" | 10 #include "components/autofill/core/common/password_form_fill_data.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 virtual bool IsSyncAccountCredential( | 45 virtual bool IsSyncAccountCredential( |
46 const std::string& username, const std::string& origin) const = 0; | 46 const std::string& username, const std::string& origin) const = 0; |
47 | 47 |
48 // Called when all autofill results have been computed. Client can use | 48 // Called when all autofill results have been computed. Client can use |
49 // this signal to report statistics. Default implementation is a noop. | 49 // this signal to report statistics. Default implementation is a noop. |
50 virtual void AutofillResultsComputed() {} | 50 virtual void AutofillResultsComputed() {} |
51 | 51 |
52 // Informs the embedder of a password form that can be saved if the user | 52 // Informs the embedder of a password form that can be saved if the user |
53 // allows it. The embedder is not required to prompt the user if it decides | 53 // allows it. The embedder is not required to prompt the user if it decides |
54 // that this form doesn't need to be saved. | 54 // that this form doesn't need to be saved. |
55 virtual void PromptUserToSavePassword( | 55 // Returns true if the prompt was indeed displayed. |
| 56 virtual bool PromptUserToSavePassword( |
56 scoped_ptr<PasswordFormManager> form_to_save) = 0; | 57 scoped_ptr<PasswordFormManager> form_to_save) = 0; |
57 | 58 |
58 // Called when a password is saved in an automated fashion. Embedder may | 59 // Called when a password is saved in an automated fashion. Embedder may |
59 // inform the user that this save has occured. | 60 // inform the user that this save has occured. |
60 virtual void AutomaticPasswordSave( | 61 virtual void AutomaticPasswordSave( |
61 scoped_ptr<PasswordFormManager> saved_form_manager) = 0; | 62 scoped_ptr<PasswordFormManager> saved_form_manager) = 0; |
62 | 63 |
63 // Called when a password is autofilled. |best_matches| contains the | 64 // Called when a password is autofilled. |best_matches| contains the |
64 // PasswordForm into which a password was filled: the client may choose to | 65 // PasswordForm into which a password was filled: the client may choose to |
65 // save this to the PasswordStore, for example. Default implementation is a | 66 // save this to the PasswordStore, for example. Default implementation is a |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 bool zero_click_only, | 134 bool zero_click_only, |
134 const std::vector<GURL>& federations) {} | 135 const std::vector<GURL>& federations) {} |
135 | 136 |
136 private: | 137 private: |
137 DISALLOW_COPY_AND_ASSIGN(PasswordManagerClient); | 138 DISALLOW_COPY_AND_ASSIGN(PasswordManagerClient); |
138 }; | 139 }; |
139 | 140 |
140 } // namespace password_manager | 141 } // namespace password_manager |
141 | 142 |
142 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_CLIENT_H_ | 143 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_CLIENT_H_ |
OLD | NEW |