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

Side by Side Diff: content/shell/app/shell_main_delegate.cc

Issue 639293005: Content Shell: Introduce LayoutTestContentBrowserClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 6 years, 2 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
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/app/shell_main_delegate.h" 5 #include "content/shell/app/shell_main_delegate.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/cpu.h" 9 #include "base/cpu.h"
10 #include "base/files/file.h" 10 #include "base/files/file.h"
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "base/lazy_instance.h" 12 #include "base/lazy_instance.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/path_service.h" 14 #include "base/path_service.h"
15 #include "cc/base/switches.h" 15 #include "cc/base/switches.h"
16 #include "content/public/browser/browser_main_runner.h" 16 #include "content/public/browser/browser_main_runner.h"
17 #include "content/public/common/content_switches.h" 17 #include "content/public/common/content_switches.h"
18 #include "content/public/common/url_constants.h" 18 #include "content/public/common/url_constants.h"
19 #include "content/public/test/layouttest_support.h" 19 #include "content/public/test/layouttest_support.h"
20 #include "content/shell/app/blink_test_platform_support.h" 20 #include "content/shell/app/blink_test_platform_support.h"
21 #include "content/shell/app/shell_crash_reporter_client.h" 21 #include "content/shell/app/shell_crash_reporter_client.h"
22 #include "content/shell/browser/layout_test/layout_test_browser_main.h" 22 #include "content/shell/browser/layout_test/layout_test_browser_main.h"
23 #include "content/shell/browser/layout_test/layout_test_content_browser_client.h "
23 #include "content/shell/browser/shell_browser_main.h" 24 #include "content/shell/browser/shell_browser_main.h"
24 #include "content/shell/browser/shell_content_browser_client.h" 25 #include "content/shell/browser/shell_content_browser_client.h"
25 #include "content/shell/common/shell_switches.h" 26 #include "content/shell/common/shell_switches.h"
26 #include "content/shell/renderer/layout_test/layout_test_content_renderer_client .h" 27 #include "content/shell/renderer/layout_test/layout_test_content_renderer_client .h"
27 #include "content/shell/renderer/shell_content_renderer_client.h" 28 #include "content/shell/renderer/shell_content_renderer_client.h"
28 #include "media/base/media_switches.h" 29 #include "media/base/media_switches.h"
29 #include "net/cookies/cookie_monster.h" 30 #include "net/cookies/cookie_monster.h"
30 #include "ui/base/resource/resource_bundle.h" 31 #include "ui/base/resource/resource_bundle.h"
31 #include "ui/base/ui_base_paths.h" 32 #include "ui/base/ui_base_paths.h"
32 #include "ui/base/ui_base_switches.h" 33 #include "ui/base/ui_base_switches.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 #else 302 #else
302 PathService::Get(base::DIR_MODULE, &pak_dir); 303 PathService::Get(base::DIR_MODULE, &pak_dir);
303 #endif 304 #endif
304 305
305 pak_file = pak_dir.Append(FILE_PATH_LITERAL("content_shell.pak")); 306 pak_file = pak_dir.Append(FILE_PATH_LITERAL("content_shell.pak"));
306 #endif 307 #endif
307 ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file); 308 ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file);
308 } 309 }
309 310
310 ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() { 311 ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() {
311 browser_client_.reset(new ShellContentBrowserClient); 312 browser_client_.reset(
313 CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree) ?
314 new LayoutTestContentBrowserClient :
315 new ShellContentBrowserClient);
316
312 return browser_client_.get(); 317 return browser_client_.get();
313 } 318 }
314 319
315 ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() { 320 ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() {
316 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) 321 renderer_client_.reset(
317 renderer_client_.reset(new LayoutTestContentRendererClient); 322 CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree) ?
318 else 323 new LayoutTestContentRendererClient :
319 renderer_client_.reset(new ShellContentRendererClient); 324 new ShellContentRendererClient);
325
320 return renderer_client_.get(); 326 return renderer_client_.get();
321 } 327 }
322 328
323 } // namespace content 329 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/BUILD.gn ('k') | content/shell/browser/layout_test/layout_test_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698