| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 #include "chrome/renderer/prerender/prerender_helper.h" | 63 #include "chrome/renderer/prerender/prerender_helper.h" |
| 64 #include "chrome/renderer/prerender/prerender_webmediaplayer.h" | 64 #include "chrome/renderer/prerender/prerender_webmediaplayer.h" |
| 65 #include "chrome/renderer/prerender/prerenderer_client.h" | 65 #include "chrome/renderer/prerender/prerenderer_client.h" |
| 66 #include "chrome/renderer/printing/print_web_view_helper.h" | 66 #include "chrome/renderer/printing/print_web_view_helper.h" |
| 67 #include "chrome/renderer/safe_browsing/malware_dom_details.h" | 67 #include "chrome/renderer/safe_browsing/malware_dom_details.h" |
| 68 #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h" | 68 #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h" |
| 69 #include "chrome/renderer/searchbox/searchbox.h" | 69 #include "chrome/renderer/searchbox/searchbox.h" |
| 70 #include "chrome/renderer/searchbox/searchbox_extension.h" | 70 #include "chrome/renderer/searchbox/searchbox_extension.h" |
| 71 #include "chrome/renderer/spellchecker/spellcheck.h" | 71 #include "chrome/renderer/spellchecker/spellcheck.h" |
| 72 #include "chrome/renderer/spellchecker/spellcheck_provider.h" | 72 #include "chrome/renderer/spellchecker/spellcheck_provider.h" |
| 73 #include "chrome/renderer/tts_dispatcher.h" |
| 73 #include "components/autofill/renderer/autofill_agent.h" | 74 #include "components/autofill/renderer/autofill_agent.h" |
| 74 #include "components/autofill/renderer/password_autofill_agent.h" | 75 #include "components/autofill/renderer/password_autofill_agent.h" |
| 75 #include "components/autofill/renderer/password_generation_manager.h" | 76 #include "components/autofill/renderer/password_generation_manager.h" |
| 76 #include "components/visitedlink/renderer/visitedlink_slave.h" | 77 #include "components/visitedlink/renderer/visitedlink_slave.h" |
| 77 #include "content/public/common/content_constants.h" | 78 #include "content/public/common/content_constants.h" |
| 78 #include "content/public/renderer/render_thread.h" | 79 #include "content/public/renderer/render_thread.h" |
| 79 #include "content/public/renderer/render_view.h" | 80 #include "content/public/renderer/render_view.h" |
| 80 #include "content/public/renderer/render_view_visitor.h" | 81 #include "content/public/renderer/render_view_visitor.h" |
| 81 #include "extensions/common/constants.h" | 82 #include "extensions/common/constants.h" |
| 82 #include "grit/generated_resources.h" | 83 #include "grit/generated_resources.h" |
| (...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1145 IsOtherExtensionWithWebRequestInstalled(); | 1146 IsOtherExtensionWithWebRequestInstalled(); |
| 1146 } | 1147 } |
| 1147 | 1148 |
| 1148 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( | 1149 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( |
| 1149 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { | 1150 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { |
| 1150 #if defined(ENABLE_PLUGINS) | 1151 #if defined(ENABLE_PLUGINS) |
| 1151 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); | 1152 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); |
| 1152 #endif | 1153 #endif |
| 1153 } | 1154 } |
| 1154 | 1155 |
| 1156 WebKit::WebSpeechSynthesizer* |
| 1157 ChromeContentRendererClient::OverrideSpeechSynthesizer( |
| 1158 WebKit::WebSpeechSynthesizerClient* client) { |
| 1159 return new TtsDispatcher(client); |
| 1160 } |
| 1161 |
| 1155 bool ChromeContentRendererClient::AllowBrowserPlugin( | 1162 bool ChromeContentRendererClient::AllowBrowserPlugin( |
| 1156 WebKit::WebPluginContainer* container) const { | 1163 WebKit::WebPluginContainer* container) const { |
| 1157 if (CommandLine::ForCurrentProcess()->HasSwitch( | 1164 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 1158 switches::kEnableBrowserPluginForAllViewTypes)) | 1165 switches::kEnableBrowserPluginForAllViewTypes)) |
| 1159 return true; | 1166 return true; |
| 1160 | 1167 |
| 1161 // If this |BrowserPlugin| <object> in the |container| is not inside a | 1168 // If this |BrowserPlugin| <object> in the |container| is not inside a |
| 1162 // <webview>/<adview> shadowHost, we disable instantiating this plugin. This | 1169 // <webview>/<adview> shadowHost, we disable instantiating this plugin. This |
| 1163 // is to discourage and prevent developers from accidentally attaching | 1170 // is to discourage and prevent developers from accidentally attaching |
| 1164 // <object> directly in apps. | 1171 // <object> directly in apps. |
| 1165 // | 1172 // |
| 1166 // Note that this check below does *not* ensure any security, it is still | 1173 // Note that this check below does *not* ensure any security, it is still |
| 1167 // possible to bypass this check. | 1174 // possible to bypass this check. |
| 1168 // TODO(lazyboy): http://crbug.com/178663, Ensure we properly disallow | 1175 // TODO(lazyboy): http://crbug.com/178663, Ensure we properly disallow |
| 1169 // instantiating BrowserPlugin outside of the <webview>/<adview> shim. | 1176 // instantiating BrowserPlugin outside of the <webview>/<adview> shim. |
| 1170 if (container->element().isNull()) | 1177 if (container->element().isNull()) |
| 1171 return false; | 1178 return false; |
| 1172 | 1179 |
| 1173 if (container->element().shadowHost().isNull()) | 1180 if (container->element().shadowHost().isNull()) |
| 1174 return false; | 1181 return false; |
| 1175 | 1182 |
| 1176 WebString tag_name = container->element().shadowHost().tagName(); | 1183 WebString tag_name = container->element().shadowHost().tagName(); |
| 1177 return tag_name.equals(WebString::fromUTF8(kWebViewTagName)) || | 1184 return tag_name.equals(WebString::fromUTF8(kWebViewTagName)) || |
| 1178 tag_name.equals(WebString::fromUTF8(kAdViewTagName)); | 1185 tag_name.equals(WebString::fromUTF8(kAdViewTagName)); |
| 1179 } | 1186 } |
| 1180 | 1187 |
| 1181 } // namespace chrome | 1188 } // namespace chrome |
| OLD | NEW |