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