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