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" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 ShellContentRendererClient::OverrideCreateMIDIAccessor( | 140 ShellContentRendererClient::OverrideCreateMIDIAccessor( |
141 WebMIDIAccessorClient* client) { | 141 WebMIDIAccessorClient* client) { |
142 WebTestInterfaces* interfaces = | 142 WebTestInterfaces* interfaces = |
143 ShellRenderProcessObserver::GetInstance()->test_interfaces(); | 143 ShellRenderProcessObserver::GetInstance()->test_interfaces(); |
144 return interfaces->createMIDIAccessor(client); | 144 return interfaces->createMIDIAccessor(client); |
145 } | 145 } |
146 | 146 |
147 WebAudioDevice* | 147 WebAudioDevice* |
148 ShellContentRendererClient::OverrideCreateAudioDevice( | 148 ShellContentRendererClient::OverrideCreateAudioDevice( |
149 double sample_rate) { | 149 double sample_rate) { |
| 150 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
| 151 return NULL; |
150 WebTestInterfaces* interfaces = | 152 WebTestInterfaces* interfaces = |
151 ShellRenderProcessObserver::GetInstance()->test_interfaces(); | 153 ShellRenderProcessObserver::GetInstance()->test_interfaces(); |
152 return interfaces->createAudioDevice(sample_rate); | 154 return interfaces->createAudioDevice(sample_rate); |
153 } | 155 } |
154 | 156 |
155 WebClipboard* ShellContentRendererClient::OverrideWebClipboard() { | 157 WebClipboard* ShellContentRendererClient::OverrideWebClipboard() { |
156 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | 158 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
157 return NULL; | 159 return NULL; |
158 if (!clipboard_) | 160 if (!clipboard_) |
159 clipboard_.reset(new MockWebClipboardImpl); | 161 clipboard_.reset(new MockWebClipboardImpl); |
(...skipping 24 matching lines...) Expand all Loading... |
184 if (CommandLine::ForCurrentProcess()->HasSwitch( | 186 if (CommandLine::ForCurrentProcess()->HasSwitch( |
185 switches::kEnableBrowserPluginForAllViewTypes)) { | 187 switches::kEnableBrowserPluginForAllViewTypes)) { |
186 // Allow BrowserPlugin if forced by command line flag. This is generally | 188 // Allow BrowserPlugin if forced by command line flag. This is generally |
187 // true for tests. | 189 // true for tests. |
188 return true; | 190 return true; |
189 } | 191 } |
190 return ContentRendererClient::AllowBrowserPlugin(container); | 192 return ContentRendererClient::AllowBrowserPlugin(container); |
191 } | 193 } |
192 | 194 |
193 } // namespace content | 195 } // namespace content |
OLD | NEW |