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 a45e4e7ffb242dc77b66e5ff5ae14be4692076da..acecde8189618b9dd53af1aca61296936662952e 100644 |
--- a/chrome/browser/chromeos/attestation/platform_verification_dialog.cc |
+++ b/chrome/browser/chromeos/attestation/platform_verification_dialog.cc |
@@ -5,6 +5,7 @@ |
#include "chrome/browser/chromeos/attestation/platform_verification_dialog.h" |
#include "base/strings/utf_string_conversions.h" |
+#include "chrome/browser/extensions/extension_service.h" |
#include "chrome/browser/ui/browser_finder.h" |
#include "chrome/browser/ui/browser_window.h" |
#include "chrome/browser/ui/singleton_tabs.h" |
@@ -13,6 +14,8 @@ |
#include "components/web_modal/web_contents_modal_dialog_manager.h" |
#include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" |
#include "content/public/browser/web_contents.h" |
+#include "extensions/browser/extension_system.h" |
+#include "extensions/common/extension.h" |
#include "grit/generated_resources.h" |
#include "ui/aura/window.h" |
#include "ui/base/l10n/l10n_util.h" |
@@ -35,7 +38,15 @@ const int kDialogMaxWidthInPixel = 400; |
void PlatformVerificationDialog::ShowDialog( |
content::WebContents* web_contents, |
const PlatformVerificationFlow::Delegate::ConsentCallback& callback) { |
- std::string origin = web_contents->GetLastCommittedURL().GetOrigin().spec(); |
+ GURL url = web_contents->GetLastCommittedURL(); |
+ std::string origin = url.GetOrigin().spec(); |
+ // 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::ExtensionSystem::Get(web_contents->GetBrowserContext())-> |
+ extension_service()->GetInstalledExtensionByUrl(url); |
not at google - send to devlin
2014/02/19 03:37:21
could you use ExtensionRegistry instead? we're try
Darren Krahn
2014/02/19 18:11:26
Done.
|
+ if (extension) |
+ origin = extension->name(); |
PlatformVerificationDialog* dialog = new PlatformVerificationDialog( |
chrome::FindBrowserWithWebContents(web_contents), |