| 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/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 11 #include "components/password_manager/core/browser/credential_manager_dispatcher
.h" | 12 #include "components/password_manager/core/browser/credential_manager_dispatcher
.h" |
| 12 #include "components/password_manager/core/browser/password_store_consumer.h" | 13 #include "components/password_manager/core/browser/password_store_consumer.h" |
| 13 #include "content/public/browser/web_contents_observer.h" | 14 #include "content/public/browser/web_contents_observer.h" |
| 14 | 15 |
| 15 class GURL; | 16 class GURL; |
| 16 | 17 |
| 17 namespace autofill { | 18 namespace autofill { |
| 18 struct PasswordForm; | 19 struct PasswordForm; |
| 19 } | 20 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 bool OnMessageReceived(const IPC::Message& message) override; | 55 bool OnMessageReceived(const IPC::Message& message) override; |
| 55 | 56 |
| 56 // PasswordStoreConsumer implementation. | 57 // PasswordStoreConsumer implementation. |
| 57 void OnGetPasswordStoreResults( | 58 void OnGetPasswordStoreResults( |
| 58 const std::vector<autofill::PasswordForm*>& results) override; | 59 const std::vector<autofill::PasswordForm*>& results) override; |
| 59 | 60 |
| 60 using CredentialCallback = | 61 using CredentialCallback = |
| 61 base::Callback<void(const autofill::PasswordForm&)>; | 62 base::Callback<void(const autofill::PasswordForm&)>; |
| 62 | 63 |
| 63 private: | 64 private: |
| 65 struct PendingRequestParameters; |
| 66 |
| 64 PasswordStore* GetPasswordStore(); | 67 PasswordStore* GetPasswordStore(); |
| 65 | 68 |
| 66 // Returns the driver for the current main frame. | 69 // Returns the driver for the current main frame. |
| 67 // Virtual for testing. | 70 // Virtual for testing. |
| 68 virtual base::WeakPtr<PasswordManagerDriver> GetDriver(); | 71 virtual base::WeakPtr<PasswordManagerDriver> GetDriver(); |
| 69 | 72 |
| 70 void SendCredential(int request_id, const CredentialInfo& info); | 73 void SendCredential(int request_id, const CredentialInfo& info); |
| 71 | 74 |
| 72 PasswordManagerClient* client_; | 75 PasswordManagerClient* client_; |
| 73 scoped_ptr<CredentialManagerPasswordFormManager> form_manager_; | 76 scoped_ptr<CredentialManagerPasswordFormManager> form_manager_; |
| 74 | 77 |
| 75 // When 'OnRequestCredential' is called, it in turn calls out to the | 78 // When 'OnRequestCredential' is called, it in turn calls out to the |
| 76 // PasswordStore; we store the request ID here in order to properly respond | 79 // PasswordStore; we store request details here in order to properly |
| 77 // to the request once the PasswordStore gives us data. | 80 // respond to the request once the PasswordStore gives us data. |
| 78 int pending_request_id_; | 81 scoped_ptr<PendingRequestParameters> pending_request_; |
| 79 | 82 |
| 80 DISALLOW_COPY_AND_ASSIGN(ContentCredentialManagerDispatcher); | 83 DISALLOW_COPY_AND_ASSIGN(ContentCredentialManagerDispatcher); |
| 81 }; | 84 }; |
| 82 | 85 |
| 83 } // namespace password_manager | 86 } // namespace password_manager |
| 84 | 87 |
| 85 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGE
R_DISPATCHER_H_ | 88 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGE
R_DISPATCHER_H_ |
| OLD | NEW |