Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1050)

Side by Side Diff: content/shell/renderer/shell_content_renderer_client.cc

Issue 19594005: Use a mock implementation of Platform::crypto() for layout tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase onto master Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/shell/renderer/shell_content_renderer_client.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 } 163 }
164 164
165 WebClipboard* ShellContentRendererClient::OverrideWebClipboard() { 165 WebClipboard* ShellContentRendererClient::OverrideWebClipboard() {
166 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) 166 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
167 return NULL; 167 return NULL;
168 if (!clipboard_) 168 if (!clipboard_)
169 clipboard_.reset(new MockWebClipboardImpl); 169 clipboard_.reset(new MockWebClipboardImpl);
170 return clipboard_.get(); 170 return clipboard_.get();
171 } 171 }
172 172
173 WebKit::WebCrypto* ShellContentRendererClient::OverrideWebCrypto() {
174 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
175 return NULL;
176 WebTestInterfaces* interfaces =
177 ShellRenderProcessObserver::GetInstance()->test_interfaces();
178 return interfaces->crypto();
179 }
180
173 WebHyphenator* ShellContentRendererClient::OverrideWebHyphenator() { 181 WebHyphenator* ShellContentRendererClient::OverrideWebHyphenator() {
174 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) 182 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
175 return NULL; 183 return NULL;
176 if (!hyphenator_) 184 if (!hyphenator_)
177 hyphenator_.reset(new webkit_glue::MockWebHyphenator); 185 hyphenator_.reset(new webkit_glue::MockWebHyphenator);
178 return hyphenator_.get(); 186 return hyphenator_.get();
179 187
180 } 188 }
181 189
182 WebThemeEngine* ShellContentRendererClient::OverrideThemeEngine() { 190 WebThemeEngine* ShellContentRendererClient::OverrideThemeEngine() {
(...skipping 20 matching lines...) Expand all
203 if (CommandLine::ForCurrentProcess()->HasSwitch( 211 if (CommandLine::ForCurrentProcess()->HasSwitch(
204 switches::kEnableBrowserPluginForAllViewTypes)) { 212 switches::kEnableBrowserPluginForAllViewTypes)) {
205 // Allow BrowserPlugin if forced by command line flag. This is generally 213 // Allow BrowserPlugin if forced by command line flag. This is generally
206 // true for tests. 214 // true for tests.
207 return true; 215 return true;
208 } 216 }
209 return ContentRendererClient::AllowBrowserPlugin(container); 217 return ContentRendererClient::AllowBrowserPlugin(container);
210 } 218 }
211 219
212 } // namespace content 220 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/renderer/shell_content_renderer_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698