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