| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // Handles save-as-new or update of the form managed by this manager. | 93 // Handles save-as-new or update of the form managed by this manager. |
| 94 // Note the basic data of updated_credentials must match that of | 94 // Note the basic data of updated_credentials must match that of |
| 95 // observed_form_ (e.g DoesManage(pending_credentials_) == true). | 95 // observed_form_ (e.g DoesManage(pending_credentials_) == true). |
| 96 void Save(); | 96 void Save(); |
| 97 | 97 |
| 98 // Call these if/when we know the form submission worked or failed. | 98 // Call these if/when we know the form submission worked or failed. |
| 99 // These routines are used to update internal statistics ("ActionsTaken"). | 99 // These routines are used to update internal statistics ("ActionsTaken"). |
| 100 void SubmitPassed(); | 100 void SubmitPassed(); |
| 101 void SubmitFailed(); | 101 void SubmitFailed(); |
| 102 | 102 |
| 103 // Return the username associated with the credentials. |
| 104 const string16& associated_username() const { |
| 105 return pending_credentials_.username_value; |
| 106 } |
| 107 |
| 103 // Returns the realm URL for the form managed my this manager. | 108 // Returns the realm URL for the form managed my this manager. |
| 104 const std::string& realm() const { | 109 const std::string& realm() const { |
| 105 return pending_credentials_.signon_realm; | 110 return pending_credentials_.signon_realm; |
| 106 } | 111 } |
| 107 | 112 |
| 108 private: | 113 private: |
| 109 friend class PasswordFormManagerTest; | 114 friend class PasswordFormManagerTest; |
| 110 | 115 |
| 111 // ManagerAction - What does the manager do with this form? Either it | 116 // ManagerAction - What does the manager do with this form? Either it |
| 112 // fills it, or it doesn't. If it doesn't fill it, that's either | 117 // fills it, or it doesn't. If it doesn't fill it, that's either |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 // These three fields record the "ActionsTaken" by the browser and | 241 // These three fields record the "ActionsTaken" by the browser and |
| 237 // the user with this form, and the result. They are combined and | 242 // the user with this form, and the result. They are combined and |
| 238 // recorded in UMA when the manager is destroyed. | 243 // recorded in UMA when the manager is destroyed. |
| 239 ManagerAction manager_action_; | 244 ManagerAction manager_action_; |
| 240 UserAction user_action_; | 245 UserAction user_action_; |
| 241 SubmitResult submit_result_; | 246 SubmitResult submit_result_; |
| 242 | 247 |
| 243 DISALLOW_COPY_AND_ASSIGN(PasswordFormManager); | 248 DISALLOW_COPY_AND_ASSIGN(PasswordFormManager); |
| 244 }; | 249 }; |
| 245 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ | 250 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_MANAGER_H_ |
| OLD | NEW |