| 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 "content/shell/renderer/shell_content_renderer_client.h" | 5 #include "content/shell/renderer/shell_content_renderer_client.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/debugger.h" | 9 #include "base/debug/debugger.h" |
| 10 #include "content/public/common/content_constants.h" | 10 #include "content/public/common/content_constants.h" |
| 11 #include "content/public/common/content_switches.h" | 11 #include "content/public/common/content_switches.h" |
| 12 #include "content/public/renderer/render_view.h" | 12 #include "content/public/renderer/render_view.h" |
| 13 #include "content/public/test/layouttest_support.h" | 13 #include "content/public/test/layouttest_support.h" |
| 14 #include "content/shell/common/shell_switches.h" | 14 #include "content/shell/common/shell_switches.h" |
| 15 #include "content/shell/renderer/shell_render_process_observer.h" | 15 #include "content/shell/renderer/shell_render_process_observer.h" |
| 16 #include "content/shell/renderer/shell_render_view_observer.h" | 16 #include "content/shell/renderer/shell_render_view_observer.h" |
| 17 #include "content/shell/renderer/webkit_test_runner.h" | 17 #include "content/shell/renderer/webkit_test_runner.h" |
| 18 #include "content/test/mock_webclipboard_impl.h" | 18 #include "content/test/mock_webclipboard_impl.h" |
| 19 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" | 19 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" |
| 20 #include "third_party/WebKit/public/testing/WebTestInterfaces.h" | 20 #include "third_party/WebKit/public/testing/WebTestInterfaces.h" |
| 21 #include "third_party/WebKit/public/testing/WebTestProxy.h" | 21 #include "third_party/WebKit/public/testing/WebTestProxy.h" |
| 22 #include "third_party/WebKit/public/testing/WebTestRunner.h" | 22 #include "third_party/WebKit/public/testing/WebTestRunner.h" |
| 23 #include "third_party/WebKit/public/web/WebPluginParams.h" | 23 #include "third_party/WebKit/public/web/WebPluginParams.h" |
| 24 #include "third_party/WebKit/public/web/WebView.h" | 24 #include "third_party/WebKit/public/web/WebView.h" |
| 25 #include "v8/include/v8.h" | 25 #include "v8/include/v8.h" |
| 26 | 26 |
| 27 using WebKit::WebAudioDevice; | 27 using blink::WebAudioDevice; |
| 28 using WebKit::WebClipboard; | 28 using blink::WebClipboard; |
| 29 using WebKit::WebFrame; | 29 using blink::WebFrame; |
| 30 using WebKit::WebMIDIAccessor; | 30 using blink::WebMIDIAccessor; |
| 31 using WebKit::WebMIDIAccessorClient; | 31 using blink::WebMIDIAccessorClient; |
| 32 using WebKit::WebMediaStreamCenter; | 32 using blink::WebMediaStreamCenter; |
| 33 using WebKit::WebMediaStreamCenterClient; | 33 using blink::WebMediaStreamCenterClient; |
| 34 using WebKit::WebPlugin; | 34 using blink::WebPlugin; |
| 35 using WebKit::WebPluginParams; | 35 using blink::WebPluginParams; |
| 36 using WebKit::WebRTCPeerConnectionHandler; | 36 using blink::WebRTCPeerConnectionHandler; |
| 37 using WebKit::WebRTCPeerConnectionHandlerClient; | 37 using blink::WebRTCPeerConnectionHandlerClient; |
| 38 using WebKit::WebThemeEngine; | 38 using blink::WebThemeEngine; |
| 39 using WebTestRunner::WebTestDelegate; | 39 using WebTestRunner::WebTestDelegate; |
| 40 using WebTestRunner::WebTestInterfaces; | 40 using WebTestRunner::WebTestInterfaces; |
| 41 using WebTestRunner::WebTestProxyBase; | 41 using WebTestRunner::WebTestProxyBase; |
| 42 | 42 |
| 43 namespace content { | 43 namespace content { |
| 44 | 44 |
| 45 namespace { | 45 namespace { |
| 46 ShellContentRendererClient* g_renderer_client; | 46 ShellContentRendererClient* g_renderer_client; |
| 47 } | 47 } |
| 48 | 48 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 test_runner->set_proxy(proxy); | 173 test_runner->set_proxy(proxy); |
| 174 if (!ShellRenderProcessObserver::GetInstance()->test_delegate()) | 174 if (!ShellRenderProcessObserver::GetInstance()->test_delegate()) |
| 175 ShellRenderProcessObserver::GetInstance()->SetTestDelegate(test_runner); | 175 ShellRenderProcessObserver::GetInstance()->SetTestDelegate(test_runner); |
| 176 proxy->setInterfaces( | 176 proxy->setInterfaces( |
| 177 ShellRenderProcessObserver::GetInstance()->test_interfaces()); | 177 ShellRenderProcessObserver::GetInstance()->test_interfaces()); |
| 178 test_runner->proxy()->setDelegate( | 178 test_runner->proxy()->setDelegate( |
| 179 ShellRenderProcessObserver::GetInstance()->test_delegate()); | 179 ShellRenderProcessObserver::GetInstance()->test_delegate()); |
| 180 } | 180 } |
| 181 | 181 |
| 182 bool ShellContentRendererClient::AllowBrowserPlugin( | 182 bool ShellContentRendererClient::AllowBrowserPlugin( |
| 183 WebKit::WebPluginContainer* container) { | 183 blink::WebPluginContainer* container) { |
| 184 if (CommandLine::ForCurrentProcess()->HasSwitch( | 184 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 185 switches::kEnableBrowserPluginForAllViewTypes)) { | 185 switches::kEnableBrowserPluginForAllViewTypes)) { |
| 186 // Allow BrowserPlugin if forced by command line flag. This is generally | 186 // Allow BrowserPlugin if forced by command line flag. This is generally |
| 187 // true for tests. | 187 // true for tests. |
| 188 return true; | 188 return true; |
| 189 } | 189 } |
| 190 return ContentRendererClient::AllowBrowserPlugin(container); | 190 return ContentRendererClient::AllowBrowserPlugin(container); |
| 191 } | 191 } |
| 192 | 192 |
| 193 } // namespace content | 193 } // namespace content |
| OLD | NEW |