Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: components/password_manager/content/browser/credential_manager_impl.h

Issue 2947413002: Restrict CM API interface request and message dispatch. (Closed)
Patch Set: Address nit from clamy@. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_pr event_silent_access_task.h" 15 #include "components/password_manager/core/browser/credential_manager_pending_pr event_silent_access_task.h"
16 #include "components/password_manager/core/browser/credential_manager_pending_re quest_task.h" 16 #include "components/password_manager/core/browser/credential_manager_pending_re quest_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/password_manager/core/common/credential_manager_types.h"
19 #include "components/prefs/pref_member.h" 19 #include "components/prefs/pref_member.h"
20 #include "content/public/browser/web_contents_observer.h" 20 #include "content/public/browser/web_contents_observer.h"
21 #include "mojo/public/cpp/bindings/binding_set.h" 21 #include "mojo/public/cpp/bindings/associated_binding.h"
22 22
23 class GURL; 23 class GURL;
24 24
25 namespace autofill { 25 namespace autofill {
26 struct PasswordForm; 26 struct PasswordForm;
27 } 27 }
28 28
29 namespace content { 29 namespace content {
30 class WebContents; 30 class WebContents;
31 } 31 }
32 32
33 namespace password_manager { 33 namespace password_manager {
34 class CredentialManagerPasswordFormManager; 34 class CredentialManagerPasswordFormManager;
35 class PasswordManagerClient; 35 class PasswordManagerClient;
36 class PasswordManagerDriver; 36 class PasswordManagerDriver;
37 class PasswordStore; 37 class PasswordStore;
38 struct CredentialInfo; 38 struct CredentialInfo;
39 39
40 class CredentialManagerImpl 40 class CredentialManagerImpl
41 : public mojom::CredentialManager, 41 : public mojom::CredentialManager,
42 public content::WebContentsObserver, 42 public content::WebContentsObserver,
43 public CredentialManagerPasswordFormManagerDelegate, 43 public CredentialManagerPasswordFormManagerDelegate,
44 public CredentialManagerPendingRequestTaskDelegate, 44 public CredentialManagerPendingRequestTaskDelegate,
45 public CredentialManagerPendingPreventSilentAccessTaskDelegate { 45 public CredentialManagerPendingPreventSilentAccessTaskDelegate {
46 public: 46 public:
47 CredentialManagerImpl(content::WebContents* web_contents, 47 CredentialManagerImpl(content::WebContents* web_contents,
48 PasswordManagerClient* client); 48 PasswordManagerClient* client);
49 ~CredentialManagerImpl() override; 49 ~CredentialManagerImpl() override;
50 50
51 void BindRequest(mojom::CredentialManagerRequest request); 51 void BindRequest(mojom::CredentialManagerAssociatedRequest request);
52 bool HasBinding() const;
53 void DisconnectBinding();
52 54
53 // mojom::CredentialManager methods: 55 // mojom::CredentialManager methods:
54 void Store(const CredentialInfo& credential, StoreCallback callback) override; 56 void Store(const CredentialInfo& credential, StoreCallback callback) override;
55 void PreventSilentAccess(PreventSilentAccessCallback callback) override; 57 void PreventSilentAccess(PreventSilentAccessCallback callback) override;
56 void Get(CredentialMediationRequirement mediation, 58 void Get(CredentialMediationRequirement mediation,
57 bool include_passwords, 59 bool include_passwords,
58 const std::vector<GURL>& federations, 60 const std::vector<GURL>& federations,
59 GetCallback callback) override; 61 GetCallback callback) override;
60 62
61 // CredentialManagerPendingRequestTaskDelegate: 63 // CredentialManagerPendingRequestTaskDelegate:
(...skipping 28 matching lines...) Expand all
90 BooleanPrefMember auto_signin_enabled_; 92 BooleanPrefMember auto_signin_enabled_;
91 93
92 // When 'OnRequestCredential' is called, it in turn calls out to the 94 // When 'OnRequestCredential' is called, it in turn calls out to the
93 // PasswordStore; we push enough data into Pending*Task objects so that 95 // PasswordStore; we push enough data into Pending*Task objects so that
94 // they can properly respond to the request once the PasswordStore gives 96 // they can properly respond to the request once the PasswordStore gives
95 // us data. 97 // us data.
96 std::unique_ptr<CredentialManagerPendingRequestTask> pending_request_; 98 std::unique_ptr<CredentialManagerPendingRequestTask> pending_request_;
97 std::unique_ptr<CredentialManagerPendingPreventSilentAccessTask> 99 std::unique_ptr<CredentialManagerPendingPreventSilentAccessTask>
98 pending_require_user_mediation_; 100 pending_require_user_mediation_;
99 101
100 mojo::BindingSet<mojom::CredentialManager> bindings_; 102 mojo::AssociatedBinding<mojom::CredentialManager> binding_;
101 103
102 base::WeakPtrFactory<CredentialManagerImpl> weak_factory_; 104 base::WeakPtrFactory<CredentialManagerImpl> weak_factory_;
103 105
104 DISALLOW_COPY_AND_ASSIGN(CredentialManagerImpl); 106 DISALLOW_COPY_AND_ASSIGN(CredentialManagerImpl);
105 }; 107 };
106 108
107 } // namespace password_manager 109 } // namespace password_manager
108 110
109 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGE R_IMPL_H_ 111 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_CREDENTIAL_MANAGE R_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698