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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 class Delegate { | 85 class Delegate { |
86 public: | 86 public: |
87 virtual ~Delegate() {} | 87 virtual ~Delegate() {} |
88 | 88 |
89 // This callback will be called when a user has given a |response| to a | 89 // This callback will be called when a user has given a |response| to a |
90 // consent request of the specified |type|. | 90 // consent request of the specified |type|. |
91 typedef base::Callback<void(ConsentResponse response)> ConsentCallback; | 91 typedef base::Callback<void(ConsentResponse response)> ConsentCallback; |
92 | 92 |
93 // Invokes consent UI within the context of |web_contents| and calls | 93 // Invokes consent UI within the context of |web_contents| and calls |
94 // |callback| when the user responds. | 94 // |callback| when the user responds. |
95 // Precondition: The last committed URL for |web_contents| has a valid | 95 // |requesting_origin| or the extension/app name will be shown on the prompt |
96 // origin. | 96 // if the request comes from a web page or an extension/app, respectively. |
97 virtual void ShowConsentPrompt(content::WebContents* web_contents, | 97 virtual void ShowConsentPrompt(content::WebContents* web_contents, |
| 98 const GURL& requesting_origin, |
98 const ConsentCallback& callback) = 0; | 99 const ConsentCallback& callback) = 0; |
99 | 100 |
100 // Gets prefs associated with the given |web_contents|. If no prefs are | 101 // Gets prefs associated with the given |web_contents|. If no prefs are |
101 // associated with |web_contents| then NULL is returned. | 102 // associated with |web_contents| then NULL is returned. |
102 virtual PrefService* GetPrefs(content::WebContents* web_contents) = 0; | 103 virtual PrefService* GetPrefs(content::WebContents* web_contents) = 0; |
103 | 104 |
104 // Gets the URL associated with the given |web_contents|. | 105 // Gets the URL associated with the given |web_contents|. |
105 virtual const GURL& GetURL(content::WebContents* web_contents) = 0; | 106 virtual const GURL& GetURL(content::WebContents* web_contents) = 0; |
106 | 107 |
107 // Gets the user associated with the given |web_contents|. NULL may be | 108 // Gets the user associated with the given |web_contents|. NULL may be |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 scoped_ptr<Delegate> default_delegate_; | 280 scoped_ptr<Delegate> default_delegate_; |
280 base::TimeDelta timeout_delay_; | 281 base::TimeDelta timeout_delay_; |
281 | 282 |
282 DISALLOW_COPY_AND_ASSIGN(PlatformVerificationFlow); | 283 DISALLOW_COPY_AND_ASSIGN(PlatformVerificationFlow); |
283 }; | 284 }; |
284 | 285 |
285 } // namespace attestation | 286 } // namespace attestation |
286 } // namespace chromeos | 287 } // namespace chromeos |
287 | 288 |
288 #endif // CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_FLOW_H_ | 289 #endif // CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_FLOW_H_ |
OLD | NEW |