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_I MPL_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGER_I MPL_H_ |
6 #define COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGER_I MPL_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGER_I MPL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "components/password_manager/content/common/credential_manager.mojom.h" | 13 #include "components/password_manager/content/common/credential_manager.mojom.h" |
14 #include "components/password_manager/core/browser/credential_manager_password_f orm_manager.h" | 14 #include "components/password_manager/core/browser/credential_manager_password_f orm_manager.h" |
15 #include "components/password_manager/core/browser/credential_manager_pending_re quest_task.h" | 15 #include "components/password_manager/core/browser/credential_manager_pending_re quest_task.h" |
16 #include "components/password_manager/core/browser/credential_manager_pending_re quire_user_mediation_task.h" | 16 #include "components/password_manager/core/browser/credential_manager_pending_re quire_user_mediation_task.h" |
17 #include "components/password_manager/core/browser/password_store_consumer.h" | 17 #include "components/password_manager/core/browser/password_store_consumer.h" |
18 #include "components/password_manager/core/common/credential_manager_types.h" | |
18 #include "components/prefs/pref_member.h" | 19 #include "components/prefs/pref_member.h" |
19 #include "content/public/browser/web_contents_observer.h" | 20 #include "content/public/browser/web_contents_observer.h" |
20 #include "mojo/public/cpp/bindings/binding_set.h" | 21 #include "mojo/public/cpp/bindings/binding_set.h" |
21 | 22 |
22 class GURL; | 23 class GURL; |
23 | 24 |
24 namespace autofill { | 25 namespace autofill { |
25 struct PasswordForm; | 26 struct PasswordForm; |
26 } | 27 } |
27 | 28 |
(...skipping 17 matching lines...) Expand all Loading... | |
45 public: | 46 public: |
46 CredentialManagerImpl(content::WebContents* web_contents, | 47 CredentialManagerImpl(content::WebContents* web_contents, |
47 PasswordManagerClient* client); | 48 PasswordManagerClient* client); |
48 ~CredentialManagerImpl() override; | 49 ~CredentialManagerImpl() override; |
49 | 50 |
50 void BindRequest(mojom::CredentialManagerRequest request); | 51 void BindRequest(mojom::CredentialManagerRequest request); |
51 | 52 |
52 // mojom::CredentialManager methods: | 53 // mojom::CredentialManager methods: |
53 void Store(const CredentialInfo& credential, StoreCallback callback) override; | 54 void Store(const CredentialInfo& credential, StoreCallback callback) override; |
54 void RequireUserMediation(RequireUserMediationCallback callback) override; | 55 void RequireUserMediation(RequireUserMediationCallback callback) override; |
55 void Get(bool zero_click_only, | 56 void Get(mojom::CredentialMediationRequirement mediation, |
vasilii
2017/05/18 12:34:03
Can we use only the enum declared in credential_ma
jdoerrie
2017/05/18 14:57:24
Done, this required entries in
components/passwor
| |
56 bool include_passwords, | 57 bool include_passwords, |
57 const std::vector<GURL>& federations, | 58 const std::vector<GURL>& federations, |
58 GetCallback callback) override; | 59 GetCallback callback) override; |
59 | 60 |
60 // CredentialManagerPendingRequestTaskDelegate: | 61 // CredentialManagerPendingRequestTaskDelegate: |
61 bool IsZeroClickAllowed() const override; | 62 bool IsZeroClickAllowed() const override; |
62 GURL GetOrigin() const override; | 63 GURL GetOrigin() const override; |
63 void SendCredential(const SendCredentialCallback& send_callback, | 64 void SendCredential(const SendCredentialCallback& send_callback, |
64 const CredentialInfo& info) override; | 65 const CredentialInfo& info) override; |
65 void SendPasswordForm(const SendCredentialCallback& send_callback, | 66 void SendPasswordForm(const SendCredentialCallback& send_callback, |
(...skipping 14 matching lines...) Expand all Loading... | |
80 // Returns the driver for the current main frame. | 81 // Returns the driver for the current main frame. |
81 // Virtual for testing. | 82 // Virtual for testing. |
82 virtual base::WeakPtr<PasswordManagerDriver> GetDriver(); | 83 virtual base::WeakPtr<PasswordManagerDriver> GetDriver(); |
83 | 84 |
84 PasswordManagerClient* client_; | 85 PasswordManagerClient* client_; |
85 std::unique_ptr<CredentialManagerPasswordFormManager> form_manager_; | 86 std::unique_ptr<CredentialManagerPasswordFormManager> form_manager_; |
86 | 87 |
87 // Set to false to disable automatic signing in. | 88 // Set to false to disable automatic signing in. |
88 BooleanPrefMember auto_signin_enabled_; | 89 BooleanPrefMember auto_signin_enabled_; |
89 | 90 |
91 // Set during |Get|, needed to log the correct result during | |
92 // |SendPasswordForm|. | |
93 CredentialMediationRequirement mediation_; | |
94 | |
90 // When 'OnRequestCredential' is called, it in turn calls out to the | 95 // When 'OnRequestCredential' is called, it in turn calls out to the |
91 // PasswordStore; we push enough data into Pending*Task objects so that | 96 // PasswordStore; we push enough data into Pending*Task objects so that |
92 // they can properly respond to the request once the PasswordStore gives | 97 // they can properly respond to the request once the PasswordStore gives |
93 // us data. | 98 // us data. |
94 std::unique_ptr<CredentialManagerPendingRequestTask> pending_request_; | 99 std::unique_ptr<CredentialManagerPendingRequestTask> pending_request_; |
95 std::unique_ptr<CredentialManagerPendingRequireUserMediationTask> | 100 std::unique_ptr<CredentialManagerPendingRequireUserMediationTask> |
96 pending_require_user_mediation_; | 101 pending_require_user_mediation_; |
97 | 102 |
98 mojo::BindingSet<mojom::CredentialManager> bindings_; | 103 mojo::BindingSet<mojom::CredentialManager> bindings_; |
99 | 104 |
100 base::WeakPtrFactory<CredentialManagerImpl> weak_factory_; | 105 base::WeakPtrFactory<CredentialManagerImpl> weak_factory_; |
101 | 106 |
102 DISALLOW_COPY_AND_ASSIGN(CredentialManagerImpl); | 107 DISALLOW_COPY_AND_ASSIGN(CredentialManagerImpl); |
103 }; | 108 }; |
104 | 109 |
105 } // namespace password_manager | 110 } // namespace password_manager |
106 | 111 |
107 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGE R_IMPL_H_ | 112 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGE R_IMPL_H_ |
OLD | NEW |