| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 } | 153 } |
| 154 | 154 |
| 155 WebClipboard* ShellContentRendererClient::OverrideWebClipboard() { | 155 WebClipboard* ShellContentRendererClient::OverrideWebClipboard() { |
| 156 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | 156 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
| 157 return NULL; | 157 return NULL; |
| 158 if (!clipboard_) | 158 if (!clipboard_) |
| 159 clipboard_.reset(new MockWebClipboardImpl); | 159 clipboard_.reset(new MockWebClipboardImpl); |
| 160 return clipboard_.get(); | 160 return clipboard_.get(); |
| 161 } | 161 } |
| 162 | 162 |
| 163 WebKit::WebCrypto* ShellContentRendererClient::OverrideWebCrypto() { | |
| 164 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | |
| 165 return NULL; | |
| 166 WebTestInterfaces* interfaces = | |
| 167 ShellRenderProcessObserver::GetInstance()->test_interfaces(); | |
| 168 return interfaces->crypto(); | |
| 169 } | |
| 170 | |
| 171 WebThemeEngine* ShellContentRendererClient::OverrideThemeEngine() { | 163 WebThemeEngine* ShellContentRendererClient::OverrideThemeEngine() { |
| 172 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | 164 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
| 173 return NULL; | 165 return NULL; |
| 174 return ShellRenderProcessObserver::GetInstance()->test_interfaces() | 166 return ShellRenderProcessObserver::GetInstance()->test_interfaces() |
| 175 ->themeEngine(); | 167 ->themeEngine(); |
| 176 } | 168 } |
| 177 | 169 |
| 178 void ShellContentRendererClient::WebTestProxyCreated(RenderView* render_view, | 170 void ShellContentRendererClient::WebTestProxyCreated(RenderView* render_view, |
| 179 WebTestProxyBase* proxy) { | 171 WebTestProxyBase* proxy) { |
| 180 WebKitTestRunner* test_runner = new WebKitTestRunner(render_view); | 172 WebKitTestRunner* test_runner = new WebKitTestRunner(render_view); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 192 if (CommandLine::ForCurrentProcess()->HasSwitch( | 184 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 193 switches::kEnableBrowserPluginForAllViewTypes)) { | 185 switches::kEnableBrowserPluginForAllViewTypes)) { |
| 194 // Allow BrowserPlugin if forced by command line flag. This is generally | 186 // Allow BrowserPlugin if forced by command line flag. This is generally |
| 195 // true for tests. | 187 // true for tests. |
| 196 return true; | 188 return true; |
| 197 } | 189 } |
| 198 return ContentRendererClient::AllowBrowserPlugin(container); | 190 return ContentRendererClient::AllowBrowserPlugin(container); |
| 199 } | 191 } |
| 200 | 192 |
| 201 } // namespace content | 193 } // namespace content |
| OLD | NEW |