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

Unified Diff: chrome/browser/chromeos/attestation/platform_verification_dialog.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_dialog.cc
diff --git a/chrome/browser/chromeos/attestation/platform_verification_dialog.cc b/chrome/browser/chromeos/attestation/platform_verification_dialog.cc
index d3cb6b907abbf476cf7a91962df6dbae9acf0b14..a4c3fab6f1bcf7db9b25c3f83e59b00a054c3063 100644
--- a/chrome/browser/chromeos/attestation/platform_verification_dialog.cc
+++ b/chrome/browser/chromeos/attestation/platform_verification_dialog.cc
@@ -37,16 +37,20 @@ const int kDialogMaxWidthInPixel = 400;
} // namespace
// static
-void PlatformVerificationDialog::ShowDialog(
+views::Widget* PlatformVerificationDialog::ShowDialog(
content::WebContents* web_contents,
+ const GURL& requesting_origin,
const PlatformVerificationFlow::Delegate::ConsentCallback& callback) {
- GURL url = web_contents->GetLastCommittedURL();
// In the case of an extension or hosted app, the origin of the request is
// best described by the extension / app name.
const extensions::Extension* extension =
- extensions::ExtensionRegistry::Get(web_contents->GetBrowserContext())->
- enabled_extensions().GetExtensionOrAppByURL(url);
- std::string origin = extension ? extension->name() : url.GetOrigin().spec();
+ extensions::ExtensionRegistry::Get(web_contents->GetBrowserContext())
+ ->enabled_extensions()
+ .GetExtensionOrAppByURL(web_contents->GetLastCommittedURL());
+
+ // TODO(xhwang): We should only show the name if the request if from the
+ // extension's true frame. See http://crbug.com/455821
+ std::string origin = extension ? extension->name() : requesting_origin.spec();
PlatformVerificationDialog* dialog = new PlatformVerificationDialog(
web_contents,
@@ -60,6 +64,8 @@ void PlatformVerificationDialog::ShowDialog(
views::Widget* widget = views::DialogDelegate::CreateDialogWidget(
dialog, NULL, popup_manager->GetHostView());
popup_manager->ShowModalDialog(widget->GetNativeView(), web_contents);
+
+ return widget;
}
PlatformVerificationDialog::~PlatformVerificationDialog() {

Powered by Google App Engine
This is Rietveld 408576698