Chromium Code Reviews| 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/webkit_test_runner.h" | 17 #include "content/shell/renderer/webkit_test_runner.h" |
| 17 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" | 18 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" |
| 18 #include "third_party/WebKit/public/testing/WebTestInterfaces.h" | 19 #include "third_party/WebKit/public/testing/WebTestInterfaces.h" |
| 19 #include "third_party/WebKit/public/testing/WebTestProxy.h" | 20 #include "third_party/WebKit/public/testing/WebTestProxy.h" |
| 20 #include "third_party/WebKit/public/testing/WebTestRunner.h" | 21 #include "third_party/WebKit/public/testing/WebTestRunner.h" |
| 21 #include "third_party/WebKit/public/web/WebPluginParams.h" | 22 #include "third_party/WebKit/public/web/WebPluginParams.h" |
| 22 #include "third_party/WebKit/public/web/WebView.h" | 23 #include "third_party/WebKit/public/web/WebView.h" |
| 23 #include "v8/include/v8.h" | 24 #include "v8/include/v8.h" |
| 24 #include "webkit/mocks/mock_webhyphenator.h" | 25 #include "webkit/mocks/mock_webhyphenator.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 135 return NULL; | 136 return NULL; |
| 136 #if defined(ENABLE_WEBRTC) | 137 #if defined(ENABLE_WEBRTC) |
| 137 WebTestInterfaces* interfaces = | 138 WebTestInterfaces* interfaces = |
| 138 ShellRenderProcessObserver::GetInstance()->test_interfaces(); | 139 ShellRenderProcessObserver::GetInstance()->test_interfaces(); |
| 139 return interfaces->createWebRTCPeerConnectionHandler(client); | 140 return interfaces->createWebRTCPeerConnectionHandler(client); |
| 140 #else | 141 #else |
| 141 return NULL; | 142 return NULL; |
| 142 #endif | 143 #endif |
| 143 } | 144 } |
| 144 | 145 |
| 146 webkit_media::MediaStreamClient* | |
| 147 ShellContentRendererClient::OverrideCreateMediaStreamClient() { | |
| 148 if (!shell_media_stream_client_) | |
|
ddorwin
2013/06/29 01:38:30
Is there a reason this would be called multiple ti
scherkus (not reviewing)
2013/07/02 01:46:23
gets called every time we're creating a MediaStrea
| |
| 149 shell_media_stream_client_.reset(new ShellMediaStreamClient()); | |
| 150 return shell_media_stream_client_.get(); | |
| 151 } | |
| 152 | |
| 145 WebMIDIAccessor* | 153 WebMIDIAccessor* |
| 146 ShellContentRendererClient::OverrideCreateMIDIAccessor( | 154 ShellContentRendererClient::OverrideCreateMIDIAccessor( |
| 147 WebMIDIAccessorClient* client) { | 155 WebMIDIAccessorClient* client) { |
| 148 WebTestInterfaces* interfaces = | 156 WebTestInterfaces* interfaces = |
| 149 ShellRenderProcessObserver::GetInstance()->test_interfaces(); | 157 ShellRenderProcessObserver::GetInstance()->test_interfaces(); |
| 150 return interfaces->createMIDIAccessor(client); | 158 return interfaces->createMIDIAccessor(client); |
| 151 } | 159 } |
| 152 | 160 |
| 153 WebClipboard* ShellContentRendererClient::OverrideWebClipboard() { | 161 WebClipboard* ShellContentRendererClient::OverrideWebClipboard() { |
| 154 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | 162 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 191 if (CommandLine::ForCurrentProcess()->HasSwitch( | 199 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 192 switches::kEnableBrowserPluginForAllViewTypes)) { | 200 switches::kEnableBrowserPluginForAllViewTypes)) { |
| 193 // Allow BrowserPlugin if forced by command line flag. This is generally | 201 // Allow BrowserPlugin if forced by command line flag. This is generally |
| 194 // true for tests. | 202 // true for tests. |
| 195 return true; | 203 return true; |
| 196 } | 204 } |
| 197 return ContentRendererClient::AllowBrowserPlugin(container); | 205 return ContentRendererClient::AllowBrowserPlugin(container); |
| 198 } | 206 } |
| 199 | 207 |
| 200 } // namespace content | 208 } // namespace content |
| OLD | NEW |