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

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

Issue 171483003: Show the extension / app name for platform verification. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698