| 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 "components/password_manager/core/browser/password_store_consumer.h" |
| 11 #include "content/public/browser/web_contents_observer.h" | 11 #include "content/public/browser/web_contents_observer.h" |
| 12 | 12 |
| 13 class GURL; | 13 class GURL; |
| 14 | 14 |
| 15 namespace autofill { | 15 namespace autofill { |
| 16 struct PasswordForm; | 16 struct PasswordForm; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 class WebContents; | 20 class WebContents; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace password_manager { | 23 namespace password_manager { |
| 24 | 24 |
| 25 class CredentialManagerPasswordFormManager; | 25 class CredentialManagerPasswordFormManager; |
| 26 class PasswordManagerClient; | 26 class PasswordManagerClient; |
| 27 class PasswordManagerDriver; |
| 27 class PasswordStore; | 28 class PasswordStore; |
| 28 struct CredentialInfo; | 29 struct CredentialInfo; |
| 29 | 30 |
| 30 class ContentCredentialManagerDispatcher : public CredentialManagerDispatcher, | 31 class ContentCredentialManagerDispatcher : public CredentialManagerDispatcher, |
| 31 public content::WebContentsObserver, | 32 public content::WebContentsObserver, |
| 32 public PasswordStoreConsumer { | 33 public PasswordStoreConsumer { |
| 33 public: | 34 public: |
| 34 // |client| isn't yet used by this class, but is necessary for the next step: | 35 // |client| isn't yet used by this class, but is necessary for the next step: |
| 35 // wiring this up as a subclass of PasswordStoreConsumer. | 36 // wiring this up as a subclass of PasswordStoreConsumer. |
| 36 ContentCredentialManagerDispatcher(content::WebContents* web_contents, | 37 ContentCredentialManagerDispatcher(content::WebContents* web_contents, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 49 bool zero_click_only, | 50 bool zero_click_only, |
| 50 const std::vector<GURL>& federations) override; | 51 const std::vector<GURL>& federations) override; |
| 51 | 52 |
| 52 // content::WebContentsObserver implementation. | 53 // content::WebContentsObserver implementation. |
| 53 bool OnMessageReceived(const IPC::Message& message) override; | 54 bool OnMessageReceived(const IPC::Message& message) override; |
| 54 | 55 |
| 55 // PasswordStoreConsumer implementation. | 56 // PasswordStoreConsumer implementation. |
| 56 void OnGetPasswordStoreResults( | 57 void OnGetPasswordStoreResults( |
| 57 const std::vector<autofill::PasswordForm*>& results) override; | 58 const std::vector<autofill::PasswordForm*>& results) override; |
| 58 | 59 |
| 60 // For testing only. |
| 61 void set_password_manager_driver(PasswordManagerDriver* driver) { |
| 62 driver_ = driver; |
| 63 } |
| 64 |
| 59 private: | 65 private: |
| 60 PasswordStore* GetPasswordStore(); | 66 PasswordStore* GetPasswordStore(); |
| 61 | 67 |
| 62 PasswordManagerClient* client_; | 68 PasswordManagerClient* client_; |
| 69 PasswordManagerDriver* driver_; |
| 63 scoped_ptr<CredentialManagerPasswordFormManager> form_manager_; | 70 scoped_ptr<CredentialManagerPasswordFormManager> form_manager_; |
| 64 | 71 |
| 65 // When 'OnRequestCredential' is called, it in turn calls out to the | 72 // When 'OnRequestCredential' is called, it in turn calls out to the |
| 66 // PasswordStore; we store the request ID here in order to properly respond | 73 // PasswordStore; we store the request ID here in order to properly respond |
| 67 // to the request once the PasswordStore gives us data. | 74 // to the request once the PasswordStore gives us data. |
| 68 int pending_request_id_; | 75 int pending_request_id_; |
| 69 | 76 |
| 70 DISALLOW_COPY_AND_ASSIGN(ContentCredentialManagerDispatcher); | 77 DISALLOW_COPY_AND_ASSIGN(ContentCredentialManagerDispatcher); |
| 71 }; | 78 }; |
| 72 | 79 |
| 73 } // namespace password_manager | 80 } // namespace password_manager |
| 74 | 81 |
| 75 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGE
R_DISPATCHER_H_ | 82 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGE
R_DISPATCHER_H_ |
| OLD | NEW |