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

Unified Diff: chrome/browser/chromeos/attestation/platform_verification_flow.cc

Issue 881983003: media: Invoke PlatformVerificationDialog from ProtectedMediaIdentifierPermissionContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added todo + bug Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/attestation/platform_verification_flow.cc
diff --git a/chrome/browser/chromeos/attestation/platform_verification_flow.cc b/chrome/browser/chromeos/attestation/platform_verification_flow.cc
index 69765aec7d32b7a3bdc60bc6b27ea3b6bb45de12..1b95c9870c5150f54c10a518f59b4cfe2a4979b3 100644
--- a/chrome/browser/chromeos/attestation/platform_verification_flow.cc
+++ b/chrome/browser/chromeos/attestation/platform_verification_flow.cc
@@ -79,9 +79,11 @@ class DefaultDelegate : public PlatformVerificationFlow::Delegate {
void ShowConsentPrompt(
content::WebContents* web_contents,
+ const GURL& requesting_origin,
const PlatformVerificationFlow::Delegate::ConsentCallback& callback)
override {
- PlatformVerificationDialog::ShowDialog(web_contents, callback);
+ PlatformVerificationDialog::ShowDialog(web_contents, requesting_origin,
+ callback);
}
PrefService* GetPrefs(content::WebContents* web_contents) override {
@@ -235,10 +237,16 @@ void PlatformVerificationFlow::CheckConsent(const ChallengeContext& context,
this,
context,
consent_required);
- if (consent_required)
- delegate_->ShowConsentPrompt(context.web_contents, consent_callback);
- else
+ if (consent_required) {
+ // TODO(xhwang): Using delegate_->GetURL() here is not right. The consent
+ // may be requested by a frame from a different origin. This will be solved
+ // when http://crbug.com/454847 is fixed.
+ delegate_->ShowConsentPrompt(
+ context.web_contents,
+ delegate_->GetURL(context.web_contents).GetOrigin(), consent_callback);
+ } else {
consent_callback.Run(CONSENT_RESPONSE_NONE);
+ }
}
void PlatformVerificationFlow::RegisterProfilePrefs(

Powered by Google App Engine
This is Rietveld 408576698