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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 12518033: Browser Plugin: Only install BrowserPluginMessageFilter if render process supports BrowserPlugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 7 years, 9 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/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 2c0bdfe3267041f0e91f68a1d48cb7d6f4e6e451..1bdb4f038ff518203662dc1bd34b80654ea1c061 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1967,6 +1967,26 @@ content::BrowserPpapiHost*
return NULL;
}
+bool ChromeContentBrowserClient::SupportsBrowserPlugin(
+ content::BrowserContext* browser_context, const GURL& site_url) {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableBrowserPluginForAllViewTypes))
+ return true;
+
+ Profile* profile = Profile::FromBrowserContext(browser_context);
+ ExtensionService* service =
+ extensions::ExtensionSystem::Get(profile)->extension_service();
+ if (!service)
+ return false;
+
+ const Extension* extension = service->extensions()->
+ GetExtensionOrAppByURL(ExtensionURLInfo(site_url));
+ if (!extension)
+ return false;
+
+ return extension->HasAPIPermission(APIPermission::kWebView);
+}
+
bool ChromeContentBrowserClient::AllowPepperSocketAPI(
content::BrowserContext* browser_context,
const GURL& url,

Powered by Google App Engine
This is Rietveld 408576698