Show extension name in permission bubble.
This applies to browser permissions checks, not app permissions. For
example: getUserMedia. If the permission is not requested by an
extension, or the extension name cannot be looked up, the origin from
the URL is shown as before.
Tested by launching an extension that attempts to access the mic with
getUserMedia and verifying the existing behavior for a web site.
Bug: 717625
Change-Id: I4e17c97f932ee163afa2fe972687259d794e4cfc
Reviewed-on: https://chromium-review.googlesource.com/677983
Commit-Queue: Adrian Elder <[email protected]>
Reviewed-by: Scott Violet <[email protected]>
Reviewed-by: Ben Wells <[email protected]>
Reviewed-by: Chris Palmer <[email protected]>
Reviewed-by: Mustafa Emre Acer <[email protected]>
Cr-Commit-Position: refs/heads/master@{#519520}
diff --git a/chrome/browser/extensions/extension_ui_util.h b/chrome/browser/extensions/extension_ui_util.h
index f05335c..3a89e53 100644
--- a/chrome/browser/extensions/extension_ui_util.h
+++ b/chrome/browser/extensions/extension_ui_util.h
@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_UI_UTIL_H_
#define CHROME_BROWSER_EXTENSIONS_EXTENSION_UI_UTIL_H_
+#include "url/gurl.h"
+
namespace content {
class BrowserContext;
}
@@ -39,6 +41,12 @@
bool ShouldDisplayInExtensionSettings(const Extension* extension,
content::BrowserContext* context);
+// If |url| is an extension URL, returns the name of the associated extension,
+// with whitespace collapsed. Otherwise, returns empty string. |context| is used
+// to get at the extension registry.
+base::string16 GetEnabledExtensionNameForUrl(const GURL& url,
+ content::BrowserContext* context);
+
} // namespace ui_util
} // namespace extensions