| 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 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" | 80 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" |
| 81 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError.
h" | 81 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError.
h" |
| 82 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques
t.h" | 82 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques
t.h" |
| 83 #include "ui/base/l10n/l10n_util.h" | 83 #include "ui/base/l10n/l10n_util.h" |
| 84 #include "ui/base/resource/resource_bundle.h" | 84 #include "ui/base/resource/resource_bundle.h" |
| 85 #include "webkit/plugins/npapi/plugin_list.h" | 85 #include "webkit/plugins/npapi/plugin_list.h" |
| 86 #include "webkit/plugins/ppapi/plugin_module.h" | 86 #include "webkit/plugins/ppapi/plugin_module.h" |
| 87 #include "webkit/plugins/ppapi/ppapi_interface_factory.h" | 87 #include "webkit/plugins/ppapi/ppapi_interface_factory.h" |
| 88 | 88 |
| 89 using WebKit::WebCache; | 89 using WebKit::WebCache; |
| 90 using WebKit::WebConsoleMessage; |
| 90 using WebKit::WebDataSource; | 91 using WebKit::WebDataSource; |
| 91 using WebKit::WebDocument; | 92 using WebKit::WebDocument; |
| 92 using WebKit::WebFrame; | 93 using WebKit::WebFrame; |
| 93 using WebKit::WebPlugin; | 94 using WebKit::WebPlugin; |
| 94 using WebKit::WebPluginParams; | 95 using WebKit::WebPluginParams; |
| 95 using WebKit::WebSecurityOrigin; | 96 using WebKit::WebSecurityOrigin; |
| 96 using WebKit::WebSecurityPolicy; | 97 using WebKit::WebSecurityPolicy; |
| 97 using WebKit::WebString; | 98 using WebKit::WebString; |
| 98 using WebKit::WebURL; | 99 using WebKit::WebURL; |
| 99 using WebKit::WebURLError; | 100 using WebKit::WebURLError; |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 // NaCl tests for the plugin work. | 421 // NaCl tests for the plugin work. |
| 421 is_nacl_enabled = true; | 422 is_nacl_enabled = true; |
| 422 } | 423 } |
| 423 if (is_nacl_plugin || is_nacl_mime_type) { | 424 if (is_nacl_plugin || is_nacl_mime_type) { |
| 424 if (!IsNaClAllowed(plugin, | 425 if (!IsNaClAllowed(plugin, |
| 425 url, | 426 url, |
| 426 actual_mime_type, | 427 actual_mime_type, |
| 427 is_nacl_mime_type, | 428 is_nacl_mime_type, |
| 428 is_nacl_enabled, | 429 is_nacl_enabled, |
| 429 params)) { | 430 params)) { |
| 431 frame->addMessageToConsole( |
| 432 WebConsoleMessage( |
| 433 WebConsoleMessage::LevelError, |
| 434 "Only unpacked extensions and apps installed from the Chrome" |
| 435 " Web Store can load NaCl modules without enabling Native" |
| 436 " Client in about:flags.")); |
| 430 return BlockedPlugin::Create( | 437 return BlockedPlugin::Create( |
| 431 render_view, frame, params, plugin, group.get(), | 438 render_view, frame, params, plugin, group.get(), |
| 432 IDR_BLOCKED_PLUGIN_HTML, IDS_PLUGIN_BLOCKED, false, false); | 439 IDR_BLOCKED_PLUGIN_HTML, IDS_PLUGIN_BLOCKED, false, false); |
| 433 } | 440 } |
| 434 } | 441 } |
| 435 | 442 |
| 436 return render_view->CreatePlugin(frame, plugin, params); | 443 return render_view->CreatePlugin(frame, plugin, params); |
| 437 } | 444 } |
| 438 | 445 |
| 439 observer->DidBlockContentType( | 446 observer->DidBlockContentType( |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { | 826 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { |
| 820 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); | 827 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); |
| 821 } | 828 } |
| 822 | 829 |
| 823 bool ChromeContentRendererClient::AllowSocketAPI(const GURL& url) { | 830 bool ChromeContentRendererClient::AllowSocketAPI(const GURL& url) { |
| 824 return allowed_socket_origins_.find(url.host()) != | 831 return allowed_socket_origins_.find(url.host()) != |
| 825 allowed_socket_origins_.end(); | 832 allowed_socket_origins_.end(); |
| 826 } | 833 } |
| 827 | 834 |
| 828 } // namespace chrome | 835 } // namespace chrome |
| OLD | NEW |