OLD | NEW |
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/renderer/chrome_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 const WebPluginParams& params, | 320 const WebPluginParams& params, |
321 WebPlugin** plugin) { | 321 WebPlugin** plugin) { |
322 std::string orig_mime_type = params.mimeType.utf8(); | 322 std::string orig_mime_type = params.mimeType.utf8(); |
323 if (orig_mime_type == content::kBrowserPluginMimeType) { | 323 if (orig_mime_type == content::kBrowserPluginMimeType) { |
324 if (CommandLine::ForCurrentProcess()->HasSwitch( | 324 if (CommandLine::ForCurrentProcess()->HasSwitch( |
325 switches::kEnableBrowserPluginForAllViewTypes)) | 325 switches::kEnableBrowserPluginForAllViewTypes)) |
326 return false; | 326 return false; |
327 WebDocument document = frame->document(); | 327 WebDocument document = frame->document(); |
328 const extensions::Extension* extension = | 328 const extensions::Extension* extension = |
329 GetExtension(document.securityOrigin()); | 329 GetExtension(document.securityOrigin()); |
330 if (extension && extension->HasAPIPermission( | 330 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebView) && |
331 extensions::APIPermission::kWebView)) | 331 extension && |
| 332 extension->HasAPIPermission(extensions::APIPermission::kWebView)) |
332 return false; | 333 return false; |
333 } | 334 } |
334 | 335 |
335 ChromeViewHostMsg_GetPluginInfo_Output output; | 336 ChromeViewHostMsg_GetPluginInfo_Output output; |
336 render_view->Send(new ChromeViewHostMsg_GetPluginInfo( | 337 render_view->Send(new ChromeViewHostMsg_GetPluginInfo( |
337 render_view->GetRoutingID(), GURL(params.url), | 338 render_view->GetRoutingID(), GURL(params.url), |
338 frame->top()->document().url(), orig_mime_type, &output)); | 339 frame->top()->document().url(), orig_mime_type, &output)); |
339 *plugin = CreatePlugin(render_view, frame, params, output); | 340 *plugin = CreatePlugin(render_view, frame, params, output); |
340 return true; | 341 return true; |
341 } | 342 } |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 bool ChromeContentRendererClient::IsOtherExtensionWithWebRequestInstalled() { | 987 bool ChromeContentRendererClient::IsOtherExtensionWithWebRequestInstalled() { |
987 return extension_dispatcher_->IsOtherExtensionWithWebRequestInstalled(); | 988 return extension_dispatcher_->IsOtherExtensionWithWebRequestInstalled(); |
988 } | 989 } |
989 | 990 |
990 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( | 991 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( |
991 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { | 992 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { |
992 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); | 993 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); |
993 } | 994 } |
994 | 995 |
995 } // namespace chrome | 996 } // namespace chrome |
OLD | NEW |