OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGER_D
ISPATCHER_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGER_D
ISPATCHER_H_ |
6 #define COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGER_D
ISPATCHER_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGER_D
ISPATCHER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "components/password_manager/core/browser/credential_manager_dispatcher
.h" | 9 #include "components/password_manager/core/browser/credential_manager_dispatcher
.h" |
| 10 #include "components/password_manager/core/browser/password_store_consumer.h" |
10 #include "content/public/browser/web_contents_observer.h" | 11 #include "content/public/browser/web_contents_observer.h" |
11 | 12 |
12 class GURL; | 13 class GURL; |
13 | 14 |
| 15 namespace autofill { |
| 16 struct PasswordForm; |
| 17 } |
| 18 |
14 namespace content { | 19 namespace content { |
15 class WebContents; | 20 class WebContents; |
16 } | 21 } |
17 | 22 |
18 namespace password_manager { | 23 namespace password_manager { |
19 | 24 |
20 class PasswordManagerClient; | 25 class PasswordManagerClient; |
| 26 class PasswordStore; |
21 struct CredentialInfo; | 27 struct CredentialInfo; |
22 | 28 |
23 class ContentCredentialManagerDispatcher : public CredentialManagerDispatcher, | 29 class ContentCredentialManagerDispatcher : public CredentialManagerDispatcher, |
24 public content::WebContentsObserver { | 30 public content::WebContentsObserver, |
| 31 public PasswordStoreConsumer { |
25 public: | 32 public: |
26 // |client| isn't yet used by this class, but is necessary for the next step: | 33 // |client| isn't yet used by this class, but is necessary for the next step: |
27 // wiring this up as a subclass of PasswordStoreConsumer. | 34 // wiring this up as a subclass of PasswordStoreConsumer. |
28 ContentCredentialManagerDispatcher(content::WebContents* web_contents, | 35 ContentCredentialManagerDispatcher(content::WebContents* web_contents, |
29 PasswordManagerClient* client); | 36 PasswordManagerClient* client); |
30 virtual ~ContentCredentialManagerDispatcher(); | 37 virtual ~ContentCredentialManagerDispatcher(); |
31 | 38 |
32 // CredentialManagerDispatcher implementation. | 39 // CredentialManagerDispatcher implementation. |
33 virtual void OnNotifyFailedSignIn( | 40 virtual void OnNotifyFailedSignIn( |
34 int request_id, | 41 int request_id, |
35 const password_manager::CredentialInfo&) OVERRIDE; | 42 const password_manager::CredentialInfo&) OVERRIDE; |
36 virtual void OnNotifySignedIn( | 43 virtual void OnNotifySignedIn( |
37 int request_id, | 44 int request_id, |
38 const password_manager::CredentialInfo&) OVERRIDE; | 45 const password_manager::CredentialInfo&) OVERRIDE; |
39 virtual void OnNotifySignedOut(int request_id) OVERRIDE; | 46 virtual void OnNotifySignedOut(int request_id) OVERRIDE; |
40 virtual void OnRequestCredential( | 47 virtual void OnRequestCredential( |
41 int request_id, | 48 int request_id, |
42 bool zero_click_only, | 49 bool zero_click_only, |
43 const std::vector<GURL>& federations) OVERRIDE; | 50 const std::vector<GURL>& federations) OVERRIDE; |
44 | 51 |
45 // content::WebContentsObserver overrides. | 52 // content::WebContentsObserver implementation. |
46 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 53 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
47 | 54 |
| 55 // PasswordStoreConsumer implementation. |
| 56 virtual void OnGetPasswordStoreResults( |
| 57 const std::vector<autofill::PasswordForm*>& results) OVERRIDE; |
| 58 |
48 private: | 59 private: |
| 60 PasswordStore* GetPasswordStore(); |
| 61 |
49 PasswordManagerClient* client_; | 62 PasswordManagerClient* client_; |
50 | 63 |
| 64 // When 'OnRequestCredential' is called, it in turn calls out to the |
| 65 // PasswordStore; we store the request ID here in order to properly respond |
| 66 // to the request once the PasswordStore gives us data. |
| 67 int pending_request_id_; |
| 68 |
51 DISALLOW_COPY_AND_ASSIGN(ContentCredentialManagerDispatcher); | 69 DISALLOW_COPY_AND_ASSIGN(ContentCredentialManagerDispatcher); |
52 }; | 70 }; |
53 | 71 |
54 } // namespace password_manager | 72 } // namespace password_manager |
55 | 73 |
56 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGE
R_DISPATCHER_H_ | 74 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGE
R_DISPATCHER_H_ |
OLD | NEW |