| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_LOGIN_MODEL_H_ | 5 #ifndef CHROME_BROWSER_LOGIN_MODEL_H_ |
| 6 #define CHROME_BROWSER_LOGIN_MODEL_H_ | 6 #define CHROME_BROWSER_LOGIN_MODEL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 // Simple Model & Observer interfaces for a LoginView to facilitate exchanging | 10 // Simple Model & Observer interfaces for a LoginView to facilitate exchanging |
| 11 // information. | 11 // information. |
| 12 class LoginModelObserver { | 12 class LoginModelObserver { |
| 13 public: | 13 public: |
| 14 // Called by the model when a username,password pair has been identified | 14 // Called by the model when a username,password pair has been identified |
| 15 // as a match for the pending login prompt. | 15 // as a match for the pending login prompt. |
| 16 virtual void OnAutofillDataAvailable(const std::wstring& username, | 16 virtual void OnAutofillDataAvailable(const std::wstring& username, |
| 17 const std::wstring& password) = 0; | 17 const std::wstring& password) = 0; |
| 18 protected: | |
| 19 ~LoginModelObserver() {} | |
| 20 }; | 18 }; |
| 21 | 19 |
| 22 class LoginModel { | 20 class LoginModel { |
| 23 public: | 21 public: |
| 24 // Set the observer interested in the data from the model. | 22 // Set the observer interested in the data from the model. |
| 25 // observer can be null, signifying there is no longer any observer | 23 // observer can be null, signifying there is no longer any observer |
| 26 // interested in the data. | 24 // interested in the data. |
| 27 virtual void SetObserver(LoginModelObserver* observer) = 0; | 25 virtual void SetObserver(LoginModelObserver* observer) = 0; |
| 28 protected: | |
| 29 ~LoginModel() {} | |
| 30 }; | 26 }; |
| 31 | 27 |
| 32 #endif // CHROME_BROWSER_LOGIN_MODEL_H_ | 28 #endif // CHROME_BROWSER_LOGIN_MODEL_H_ |
| OLD | NEW |