| 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 13 matching lines...) Expand all Loading... |
| 24 } | 24 } |
| 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 class User; |
| 34 | 35 |
| 35 namespace system { | 36 namespace system { |
| 36 class StatisticsProvider; | 37 class StatisticsProvider; |
| 37 } | 38 } |
| 38 | 39 |
| 39 namespace attestation { | 40 namespace attestation { |
| 40 | 41 |
| 41 class AttestationFlow; | 42 class AttestationFlow; |
| 42 | 43 |
| 43 // This class allows platform verification for the content protection use case. | 44 // This class allows platform verification for the content protection use case. |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 // operation should proceed, this method invokes a certificate request. | 168 // operation should proceed, this method invokes a certificate request. |
| 168 void OnConsentResponse(content::WebContents* web_contents, | 169 void OnConsentResponse(content::WebContents* web_contents, |
| 169 const std::string& service_id, | 170 const std::string& service_id, |
| 170 const std::string& challenge, | 171 const std::string& challenge, |
| 171 const ChallengeCallback& callback, | 172 const ChallengeCallback& callback, |
| 172 ConsentType consent_type, | 173 ConsentType consent_type, |
| 173 ConsentResponse consent_response); | 174 ConsentResponse consent_response); |
| 174 | 175 |
| 175 // A callback called when an attestation certificate request operation | 176 // A callback called when an attestation certificate request operation |
| 176 // completes. |service_id|, |challenge|, and |callback| are the same as in | 177 // completes. |service_id|, |challenge|, and |callback| are the same as in |
| 177 // ChallengePlatformKey. |operation_success| is true iff the certificate | 178 // ChallengePlatformKey. |user_id| identifies the user for which the |
| 179 // certificate was requested. |operation_success| is true iff the certificate |
| 178 // request operation succeeded. |certificate| holds the certificate for the | 180 // request operation succeeded. |certificate| holds the certificate for the |
| 179 // platform key on success. If the certificate request was successful, this | 181 // platform key on success. If the certificate request was successful, this |
| 180 // method invokes a request to sign the challenge. | 182 // method invokes a request to sign the challenge. |
| 181 void OnCertificateReady(const std::string& service_id, | 183 void OnCertificateReady(const std::string& user_id, |
| 184 const std::string& service_id, |
| 182 const std::string& challenge, | 185 const std::string& challenge, |
| 183 const ChallengeCallback& callback, | 186 const ChallengeCallback& callback, |
| 184 bool operation_success, | 187 bool operation_success, |
| 185 const std::string& certificate); | 188 const std::string& certificate); |
| 186 | 189 |
| 187 // A callback called when a challenge signing request has completed. The | 190 // A callback called when a challenge signing request has completed. The |
| 188 // |certificate| is the platform certificate for the key which signed the | 191 // |certificate| is the platform certificate for the key which signed the |
| 189 // |challenge|. |callback| is the same as in ChallengePlatformKey. | 192 // |challenge|. |callback| is the same as in ChallengePlatformKey. |
| 190 // |operation_success| is true iff the challenge signing operation was | 193 // |operation_success| is true iff the challenge signing operation was |
| 191 // successful. If it was successful, |response_data| holds the challenge | 194 // successful. If it was successful, |response_data| holds the challenge |
| 192 // response and the method will invoke |callback|. | 195 // response and the method will invoke |callback|. |
| 193 void OnChallengeReady(const std::string& certificate, | 196 void OnChallengeReady(const std::string& certificate, |
| 194 const std::string& challenge, | 197 const std::string& challenge, |
| 195 const ChallengeCallback& callback, | 198 const ChallengeCallback& callback, |
| 196 bool operation_success, | 199 bool operation_success, |
| 197 const std::string& response_data); | 200 const std::string& response_data); |
| 198 | 201 |
| 199 // Gets prefs associated with the given |web_contents|. If prefs have been | 202 // Gets prefs associated with the given |web_contents|. If prefs have been |
| 200 // set explicitly using set_testing_prefs(), then these are always returned. | 203 // set explicitly using set_testing_prefs(), then these are always returned. |
| 201 // If no prefs are associated with |web_contents| then NULL is returned. | 204 // If no prefs are associated with |web_contents| then NULL is returned. |
| 202 PrefService* GetPrefs(content::WebContents* web_contents); | 205 PrefService* GetPrefs(content::WebContents* web_contents); |
| 203 | 206 |
| 204 // Gets the URL associated with the given |web_contents|. If a URL as been | 207 // Gets the URL associated with the given |web_contents|. If a URL as been |
| 205 // set explicitly using set_testing_url(), then this value is always returned. | 208 // set explicitly using set_testing_url(), then this value is always returned. |
| 206 const GURL& GetURL(content::WebContents* web_contents); | 209 const GURL& GetURL(content::WebContents* web_contents); |
| 207 | 210 |
| 211 // Gets the user associated with the given |web_contents|. NULL may be |
| 212 // returned. If |web_contents| is NULL (e.g. during testing), then the |
| 213 // current active user will be returned. |
| 214 User* GetUser(content::WebContents* web_contents); |
| 215 |
| 208 // Checks whether policy or profile settings associated with |web_contents| | 216 // Checks whether policy or profile settings associated with |web_contents| |
| 209 // have attestation for content protection explicitly disabled. | 217 // have attestation for content protection explicitly disabled. |
| 210 bool IsAttestationEnabled(content::WebContents* web_contents); | 218 bool IsAttestationEnabled(content::WebContents* web_contents); |
| 211 | 219 |
| 212 // Checks whether this is the first use on this device for the user associated | 220 // Checks whether this is the first use on this device for the user associated |
| 213 // with |web_contents|. | 221 // with |web_contents|. |
| 214 bool IsFirstUse(content::WebContents* web_contents); | 222 bool IsFirstUse(content::WebContents* web_contents); |
| 215 | 223 |
| 216 // Checks if settings indicate that consent is required for the web origin | 224 // Checks if settings indicate that consent is required for the web origin |
| 217 // represented by |web_contents| because the user requested to be prompted. | 225 // represented by |web_contents| because the user requested to be prompted. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 // invalidate the weak pointers before any other members are destroyed. | 260 // invalidate the weak pointers before any other members are destroyed. |
| 253 base::WeakPtrFactory<PlatformVerificationFlow> weak_factory_; | 261 base::WeakPtrFactory<PlatformVerificationFlow> weak_factory_; |
| 254 | 262 |
| 255 DISALLOW_COPY_AND_ASSIGN(PlatformVerificationFlow); | 263 DISALLOW_COPY_AND_ASSIGN(PlatformVerificationFlow); |
| 256 }; | 264 }; |
| 257 | 265 |
| 258 } // namespace attestation | 266 } // namespace attestation |
| 259 } // namespace chromeos | 267 } // namespace chromeos |
| 260 | 268 |
| 261 #endif // CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_FLOW_H_ | 269 #endif // CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_FLOW_H_ |
| OLD | NEW |