OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ |
6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // Handles save-as-new or update of the form managed by this manager. | 97 // Handles save-as-new or update of the form managed by this manager. |
98 // Note the basic data of updated_credentials must match that of | 98 // Note the basic data of updated_credentials must match that of |
99 // observed_form_ (e.g DoesManage(pending_credentials_) == true). | 99 // observed_form_ (e.g DoesManage(pending_credentials_) == true). |
100 void Save(); | 100 void Save(); |
101 | 101 |
102 // Call these if/when we know the form submission worked or failed. | 102 // Call these if/when we know the form submission worked or failed. |
103 // These routines are used to update internal statistics ("ActionsTaken"). | 103 // These routines are used to update internal statistics ("ActionsTaken"). |
104 void SubmitPassed(); | 104 void SubmitPassed(); |
105 void SubmitFailed(); | 105 void SubmitFailed(); |
106 | 106 |
| 107 // Return the username associated with the credentials. |
| 108 const string16& associated_username() const { |
| 109 return pending_credentials_.username_value; |
| 110 } |
| 111 |
107 // Returns the realm URL for the form managed my this manager. | 112 // Returns the realm URL for the form managed my this manager. |
108 const std::string& realm() const { | 113 const std::string& realm() const { |
109 return pending_credentials_.signon_realm; | 114 return pending_credentials_.signon_realm; |
110 } | 115 } |
111 | 116 |
112 private: | 117 private: |
113 friend class PasswordFormManagerTest; | 118 friend class PasswordFormManagerTest; |
114 | 119 |
115 // ManagerAction - What does the manager do with this form? Either it | 120 // ManagerAction - What does the manager do with this form? Either it |
116 // fills it, or it doesn't. If it doesn't fill it, that's either | 121 // fills it, or it doesn't. If it doesn't fill it, that's either |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 // These three fields record the "ActionsTaken" by the browser and | 254 // These three fields record the "ActionsTaken" by the browser and |
250 // the user with this form, and the result. They are combined and | 255 // the user with this form, and the result. They are combined and |
251 // recorded in UMA when the manager is destroyed. | 256 // recorded in UMA when the manager is destroyed. |
252 ManagerAction manager_action_; | 257 ManagerAction manager_action_; |
253 UserAction user_action_; | 258 UserAction user_action_; |
254 SubmitResult submit_result_; | 259 SubmitResult submit_result_; |
255 | 260 |
256 DISALLOW_COPY_AND_ASSIGN(PasswordFormManager); | 261 DISALLOW_COPY_AND_ASSIGN(PasswordFormManager); |
257 }; | 262 }; |
258 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ | 263 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ |
OLD | NEW |