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