| 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_media_stream_client.h" | |
| 16 #include "content/shell/renderer/shell_render_process_observer.h" | 15 #include "content/shell/renderer/shell_render_process_observer.h" |
| 17 #include "content/shell/renderer/shell_render_view_observer.h" | 16 #include "content/shell/renderer/shell_render_view_observer.h" |
| 18 #include "content/shell/renderer/webkit_test_runner.h" | 17 #include "content/shell/renderer/webkit_test_runner.h" |
| 19 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" | 18 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" |
| 20 #include "third_party/WebKit/public/testing/WebTestInterfaces.h" | 19 #include "third_party/WebKit/public/testing/WebTestInterfaces.h" |
| 21 #include "third_party/WebKit/public/testing/WebTestProxy.h" | 20 #include "third_party/WebKit/public/testing/WebTestProxy.h" |
| 22 #include "third_party/WebKit/public/testing/WebTestRunner.h" | 21 #include "third_party/WebKit/public/testing/WebTestRunner.h" |
| 23 #include "third_party/WebKit/public/web/WebPluginParams.h" | 22 #include "third_party/WebKit/public/web/WebPluginParams.h" |
| 24 #include "third_party/WebKit/public/web/WebView.h" | 23 #include "third_party/WebKit/public/web/WebView.h" |
| 25 #include "v8/include/v8.h" | 24 #include "v8/include/v8.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 return NULL; | 138 return NULL; |
| 140 #if defined(ENABLE_WEBRTC) | 139 #if defined(ENABLE_WEBRTC) |
| 141 WebTestInterfaces* interfaces = | 140 WebTestInterfaces* interfaces = |
| 142 ShellRenderProcessObserver::GetInstance()->test_interfaces(); | 141 ShellRenderProcessObserver::GetInstance()->test_interfaces(); |
| 143 return interfaces->createWebRTCPeerConnectionHandler(client); | 142 return interfaces->createWebRTCPeerConnectionHandler(client); |
| 144 #else | 143 #else |
| 145 return NULL; | 144 return NULL; |
| 146 #endif | 145 #endif |
| 147 } | 146 } |
| 148 | 147 |
| 149 webkit_media::MediaStreamClient* | |
| 150 ShellContentRendererClient::OverrideCreateMediaStreamClient() { | |
| 151 if (!shell_media_stream_client_) | |
| 152 shell_media_stream_client_.reset(new ShellMediaStreamClient()); | |
| 153 return shell_media_stream_client_.get(); | |
| 154 } | |
| 155 | |
| 156 WebMIDIAccessor* | 148 WebMIDIAccessor* |
| 157 ShellContentRendererClient::OverrideCreateMIDIAccessor( | 149 ShellContentRendererClient::OverrideCreateMIDIAccessor( |
| 158 WebMIDIAccessorClient* client) { | 150 WebMIDIAccessorClient* client) { |
| 159 WebTestInterfaces* interfaces = | 151 WebTestInterfaces* interfaces = |
| 160 ShellRenderProcessObserver::GetInstance()->test_interfaces(); | 152 ShellRenderProcessObserver::GetInstance()->test_interfaces(); |
| 161 return interfaces->createMIDIAccessor(client); | 153 return interfaces->createMIDIAccessor(client); |
| 162 } | 154 } |
| 163 | 155 |
| 164 WebClipboard* ShellContentRendererClient::OverrideWebClipboard() { | 156 WebClipboard* ShellContentRendererClient::OverrideWebClipboard() { |
| 165 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | 157 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 if (CommandLine::ForCurrentProcess()->HasSwitch( | 194 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 203 switches::kEnableBrowserPluginForAllViewTypes)) { | 195 switches::kEnableBrowserPluginForAllViewTypes)) { |
| 204 // Allow BrowserPlugin if forced by command line flag. This is generally | 196 // Allow BrowserPlugin if forced by command line flag. This is generally |
| 205 // true for tests. | 197 // true for tests. |
| 206 return true; | 198 return true; |
| 207 } | 199 } |
| 208 return ContentRendererClient::AllowBrowserPlugin(container); | 200 return ContentRendererClient::AllowBrowserPlugin(container); |
| 209 } | 201 } |
| 210 | 202 |
| 211 } // namespace content | 203 } // namespace content |
| OLD | NEW |