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..5c35c195ff44865cb905129100df8049415d3897 100644 |
--- a/chrome/browser/chromeos/attestation/platform_verification_dialog.cc |
+++ b/chrome/browser/chromeos/attestation/platform_verification_dialog.cc |
@@ -37,16 +37,19 @@ 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. |
+ GURL extension_url = web_contents->GetLastCommittedURL(); |
ddorwin
2015/02/05 03:25:26
nit: We don't actually know that this is an extens
xhwang
2015/02/05 05:46:51
Done.
|
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(extension_url); |
+ |
+ std::string origin = extension ? extension->name() : requesting_origin.spec(); |
PlatformVerificationDialog* dialog = new PlatformVerificationDialog( |
web_contents, |
@@ -60,6 +63,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() { |