OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_FLOW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_FLOW_H_ |
6 #define CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_FLOW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_FLOW_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 namespace user_prefs { | 26 namespace user_prefs { |
27 class PrefRegistrySyncable; | 27 class PrefRegistrySyncable; |
28 } | 28 } |
29 | 29 |
30 namespace chromeos { | 30 namespace chromeos { |
31 | 31 |
32 class CryptohomeClient; | 32 class CryptohomeClient; |
33 class UserManager; | 33 class UserManager; |
34 | 34 |
35 namespace system { | |
36 class StatisticsProvider; | |
37 } | |
38 | |
39 namespace attestation { | 35 namespace attestation { |
40 | 36 |
41 class AttestationFlow; | 37 class AttestationFlow; |
42 | 38 |
43 // This class allows platform verification for the content protection use case. | 39 // This class allows platform verification for the content protection use case. |
44 // All methods must only be called on the UI thread. Example: | 40 // All methods must only be called on the UI thread. Example: |
45 // PlatformVerificationFlow verifier; | 41 // PlatformVerificationFlow verifier; |
46 // PlatformVerificationFlow::Callback callback = base::Bind(&MyCallback); | 42 // PlatformVerificationFlow::Callback callback = base::Bind(&MyCallback); |
47 // verifier.ChallengePlatformKey(my_web_contents, "my_id", "some_challenge", | 43 // verifier.ChallengePlatformKey(my_web_contents, "my_id", "some_challenge", |
48 // callback); | 44 // callback); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 // A constructor that uses the default implementation of all dependencies | 101 // A constructor that uses the default implementation of all dependencies |
106 // including Delegate. | 102 // including Delegate. |
107 PlatformVerificationFlow(); | 103 PlatformVerificationFlow(); |
108 | 104 |
109 // An alternate constructor which specifies dependent objects explicitly. | 105 // An alternate constructor which specifies dependent objects explicitly. |
110 // This is useful in testing. The caller retains ownership of all pointers. | 106 // This is useful in testing. The caller retains ownership of all pointers. |
111 PlatformVerificationFlow(AttestationFlow* attestation_flow, | 107 PlatformVerificationFlow(AttestationFlow* attestation_flow, |
112 cryptohome::AsyncMethodCaller* async_caller, | 108 cryptohome::AsyncMethodCaller* async_caller, |
113 CryptohomeClient* cryptohome_client, | 109 CryptohomeClient* cryptohome_client, |
114 UserManager* user_manager, | 110 UserManager* user_manager, |
115 system::StatisticsProvider* statistics_provider, | |
116 Delegate* delegate); | 111 Delegate* delegate); |
117 | 112 |
118 virtual ~PlatformVerificationFlow(); | 113 virtual ~PlatformVerificationFlow(); |
119 | 114 |
120 // Invokes an asynchronous operation to challenge a platform key. Any user | 115 // Invokes an asynchronous operation to challenge a platform key. Any user |
121 // interaction will be associated with |web_contents|. The |service_id| is an | 116 // interaction will be associated with |web_contents|. The |service_id| is an |
122 // arbitrary value but it should uniquely identify the origin of the request | 117 // arbitrary value but it should uniquely identify the origin of the request |
123 // and should not be determined by that origin; its purpose is to prevent | 118 // and should not be determined by that origin; its purpose is to prevent |
124 // collusion between multiple services. The |challenge| is also an arbitrary | 119 // collusion between multiple services. The |challenge| is also an arbitrary |
125 // value but it should be time sensitive or associated to some kind of session | 120 // value but it should be time sensitive or associated to some kind of session |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 // | 230 // |
236 // Precondition: A valid PrefService must be available via GetPrefs(). | 231 // Precondition: A valid PrefService must be available via GetPrefs(). |
237 void RecordDomainConsent(content::WebContents* web_contents, | 232 void RecordDomainConsent(content::WebContents* web_contents, |
238 bool allow_domain); | 233 bool allow_domain); |
239 | 234 |
240 AttestationFlow* attestation_flow_; | 235 AttestationFlow* attestation_flow_; |
241 scoped_ptr<AttestationFlow> default_attestation_flow_; | 236 scoped_ptr<AttestationFlow> default_attestation_flow_; |
242 cryptohome::AsyncMethodCaller* async_caller_; | 237 cryptohome::AsyncMethodCaller* async_caller_; |
243 CryptohomeClient* cryptohome_client_; | 238 CryptohomeClient* cryptohome_client_; |
244 UserManager* user_manager_; | 239 UserManager* user_manager_; |
245 system::StatisticsProvider* statistics_provider_; | |
246 Delegate* delegate_; | 240 Delegate* delegate_; |
247 scoped_ptr<Delegate> default_delegate_; | 241 scoped_ptr<Delegate> default_delegate_; |
248 PrefService* testing_prefs_; | 242 PrefService* testing_prefs_; |
249 GURL testing_url_; | 243 GURL testing_url_; |
250 | 244 |
251 // Note: This should remain the last member so it'll be destroyed and | 245 // Note: This should remain the last member so it'll be destroyed and |
252 // invalidate the weak pointers before any other members are destroyed. | 246 // invalidate the weak pointers before any other members are destroyed. |
253 base::WeakPtrFactory<PlatformVerificationFlow> weak_factory_; | 247 base::WeakPtrFactory<PlatformVerificationFlow> weak_factory_; |
254 | 248 |
255 DISALLOW_COPY_AND_ASSIGN(PlatformVerificationFlow); | 249 DISALLOW_COPY_AND_ASSIGN(PlatformVerificationFlow); |
256 }; | 250 }; |
257 | 251 |
258 } // namespace attestation | 252 } // namespace attestation |
259 } // namespace chromeos | 253 } // namespace chromeos |
260 | 254 |
261 #endif // CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_FLOW_H_ | 255 #endif // CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_FLOW_H_ |
OLD | NEW |