Upstream version 11.40.271.0
[platform/framework/web/crosswalk.git] / src / components / password_manager / content / browser / credential_manager_password_form_manager.h
1 // Copyright (c) 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.
4
5 #ifndef COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CREDENTIAL_MANAGER_PASSWORD_FORM_MANAGER_H_
6 #define COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CREDENTIAL_MANAGER_PASSWORD_FORM_MANAGER_H_
7
8 #include "components/password_manager/core/browser/password_form_manager.h"
9
10 namespace autofill {
11 struct PasswordForm;
12 }
13
14 namespace content {
15 class WebContents;
16 }  // namespace content
17
18 namespace password_manager {
19
20 class ContentCredentialManagerDispatcher;
21 class PasswordManager;
22 class PasswordManagerClient;
23
24 // A PasswordFormManager built to handle PassworForm objects synthesized
25 // by the Credential Manager API.
26 class CredentialManagerPasswordFormManager : public PasswordFormManager {
27  public:
28   // Given a |client| and an |observed_form|, kick off the process of fetching
29   // matching logins from the password store; if |observed_form| doesn't map to
30   // a blacklisted origin, provisionally save it. Once saved, let the dispatcher
31   // know that it's safe to poke at the UI.
32   //
33   // This class does not take ownership of |dispatcher|.
34   CredentialManagerPasswordFormManager(
35       PasswordManagerClient* client,
36       const autofill::PasswordForm& observed_form,
37       ContentCredentialManagerDispatcher* dispatcher);
38   ~CredentialManagerPasswordFormManager() override;
39
40   void OnGetPasswordStoreResults(
41       const std::vector<autofill::PasswordForm*>& results) override;
42
43  private:
44   ContentCredentialManagerDispatcher* dispatcher_;
45
46   DISALLOW_COPY_AND_ASSIGN(CredentialManagerPasswordFormManager);
47 };
48
49 }  // namespace password_manager
50
51 #endif  // COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CREDENTIAL_MANAGER_PASSWORD_FORM_MANAGER_H_