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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1949 matching lines...) Expand 10 before | Expand all | Expand 10 after
1960 if (host->process() && 1960 if (host->process() &&
1961 host->process()->GetData().id == plugin_process_id) { 1961 host->process()->GetData().id == plugin_process_id) {
1962 // Found the plugin. 1962 // Found the plugin.
1963 return host->browser_ppapi_host(); 1963 return host->browser_ppapi_host();
1964 } 1964 }
1965 ++iter; 1965 ++iter;
1966 } 1966 }
1967 return NULL; 1967 return NULL;
1968 } 1968 }
1969 1969
1970 bool ChromeContentBrowserClient::SupportsBrowserPlugin(
1971 content::BrowserContext* browser_context, const GURL& site_url) {
1972 if (CommandLine::ForCurrentProcess()->HasSwitch(
1973 switches::kEnableBrowserPluginForAllViewTypes))
1974 return true;
1975
1976 Profile* profile = Profile::FromBrowserContext(browser_context);
1977 ExtensionService* service =
1978 extensions::ExtensionSystem::Get(profile)->extension_service();
1979 if (!service)
1980 return false;
1981
1982 const Extension* extension = service->extensions()->
1983 GetExtensionOrAppByURL(ExtensionURLInfo(site_url));
1984 if (!extension)
1985 return false;
1986
1987 return extension->HasAPIPermission(APIPermission::kWebView);
1988 }
1989
1970 bool ChromeContentBrowserClient::AllowPepperSocketAPI( 1990 bool ChromeContentBrowserClient::AllowPepperSocketAPI(
1971 content::BrowserContext* browser_context, 1991 content::BrowserContext* browser_context,
1972 const GURL& url, 1992 const GURL& url,
1973 const content::SocketPermissionRequest& params) { 1993 const content::SocketPermissionRequest& params) {
1974 if (!url.is_valid()) 1994 if (!url.is_valid())
1975 return false; 1995 return false;
1976 1996
1977 std::string host = url.host(); 1997 std::string host = url.host();
1978 if (url.SchemeIs(extensions::kExtensionScheme) && 1998 if (url.SchemeIs(extensions::kExtensionScheme) &&
1979 allowed_socket_origins_.count(host)) { 1999 allowed_socket_origins_.count(host)) {
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
2155 io_thread_application_locale_ = locale; 2175 io_thread_application_locale_ = locale;
2156 } 2176 }
2157 2177
2158 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( 2178 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread(
2159 const std::string& locale) { 2179 const std::string& locale) {
2160 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 2180 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
2161 io_thread_application_locale_ = locale; 2181 io_thread_application_locale_ = locale;
2162 } 2182 }
2163 2183
2164 } // namespace chrome 2184 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698