Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / components / password_manager / core / browser / login_model.h
blob04019261528429e0f8bcf26db67a5112d2e31dc3
1 // Copyright 2014 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.
5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_MODEL_H_
6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_MODEL_H_
8 #include "base/strings/string16.h"
10 namespace password_manager {
12 // Simple Model & Observer interfaces for a LoginView to facilitate exchanging
13 // information.
14 class LoginModelObserver {
15 public:
16 // Called by the model when a username,password pair has been identified
17 // as a match for the pending login prompt.
18 virtual void OnAutofillDataAvailable(const base::string16& username,
19 const base::string16& password) = 0;
21 virtual void OnLoginModelDestroying() = 0;
23 protected:
24 virtual ~LoginModelObserver() {}
27 class LoginModel {
28 public:
29 // Add an observer interested in the data from the model.
30 virtual void AddObserver(LoginModelObserver* observer) = 0;
31 // Remove an observer from the model.
32 virtual void RemoveObserver(LoginModelObserver* observer) = 0;
34 protected:
35 virtual ~LoginModel() {}
38 } // namespace password_manager
40 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_MODEL_H_