| 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/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 "build/build_config.h" |
| 15 #include "cc/base/switches.h" | 16 #include "cc/base/switches.h" |
| 16 #include "content/public/browser/browser_main_runner.h" | 17 #include "content/public/browser/browser_main_runner.h" |
| 17 #include "content/public/common/content_switches.h" | 18 #include "content/public/common/content_switches.h" |
| 18 #include "content/public/common/url_constants.h" | 19 #include "content/public/common/url_constants.h" |
| 19 #include "content/public/test/layouttest_support.h" | 20 #include "content/public/test/layouttest_support.h" |
| 20 #include "content/shell/app/blink_test_platform_support.h" | 21 #include "content/shell/app/blink_test_platform_support.h" |
| 21 #include "content/shell/app/shell_crash_reporter_client.h" | 22 #include "content/shell/app/shell_crash_reporter_client.h" |
| 22 #include "content/shell/browser/layout_test/layout_test_browser_main.h" | 23 #include "content/shell/browser/layout_test/layout_test_browser_main.h" |
| 23 #include "content/shell/browser/layout_test/layout_test_content_browser_client.h
" | 24 #include "content/shell/browser/layout_test/layout_test_content_browser_client.h
" |
| 24 #include "content/shell/browser/shell_browser_main.h" | 25 #include "content/shell/browser/shell_browser_main.h" |
| 25 #include "content/shell/browser/shell_content_browser_client.h" | 26 #include "content/shell/browser/shell_content_browser_client.h" |
| 26 #include "content/shell/common/shell_switches.h" | 27 #include "content/shell/common/shell_switches.h" |
| 27 #include "content/shell/renderer/layout_test/layout_test_content_renderer_client
.h" | 28 #include "content/shell/renderer/layout_test/layout_test_content_renderer_client
.h" |
| 28 #include "content/shell/renderer/shell_content_renderer_client.h" | 29 #include "content/shell/renderer/shell_content_renderer_client.h" |
| 29 #include "media/base/media_switches.h" | 30 #include "media/base/media_switches.h" |
| 31 #include "media/base/mime_util.h" |
| 30 #include "net/cookies/cookie_monster.h" | 32 #include "net/cookies/cookie_monster.h" |
| 31 #include "ui/base/resource/resource_bundle.h" | 33 #include "ui/base/resource/resource_bundle.h" |
| 32 #include "ui/base/ui_base_paths.h" | 34 #include "ui/base/ui_base_paths.h" |
| 33 #include "ui/base/ui_base_switches.h" | 35 #include "ui/base/ui_base_switches.h" |
| 34 #include "ui/events/event_switches.h" | 36 #include "ui/events/event_switches.h" |
| 35 #include "ui/gfx/switches.h" | 37 #include "ui/gfx/switches.h" |
| 36 #include "ui/gl/gl_switches.h" | 38 #include "ui/gl/gl_switches.h" |
| 37 | 39 |
| 38 #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. | 40 #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. |
| 39 | 41 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 201 |
| 200 command_line.AppendSwitchASCII(switches::kHostResolverRules, | 202 command_line.AppendSwitchASCII(switches::kHostResolverRules, |
| 201 "MAP *.test 127.0.0.1"); | 203 "MAP *.test 127.0.0.1"); |
| 202 | 204 |
| 203 // TODO(wfh): crbug.com/295137 Remove this when NPAPI is gone. | 205 // TODO(wfh): crbug.com/295137 Remove this when NPAPI is gone. |
| 204 command_line.AppendSwitch(switches::kEnableNpapi); | 206 command_line.AppendSwitch(switches::kEnableNpapi); |
| 205 | 207 |
| 206 // Unless/until WebM files are added to the media layout tests, we need to | 208 // Unless/until WebM files are added to the media layout tests, we need to |
| 207 // avoid removing MP4/H264/AAC so that layout tests can run on Android. | 209 // avoid removing MP4/H264/AAC so that layout tests can run on Android. |
| 208 #if !defined(OS_ANDROID) | 210 #if !defined(OS_ANDROID) |
| 209 net::RemoveProprietaryMediaTypesAndCodecsForTests(); | 211 media::RemoveProprietaryMediaTypesAndCodecsForTests(); |
| 210 #endif | 212 #endif |
| 211 | 213 |
| 212 if (!BlinkTestPlatformInitialize()) { | 214 if (!BlinkTestPlatformInitialize()) { |
| 213 if (exit_code) | 215 if (exit_code) |
| 214 *exit_code = 1; | 216 *exit_code = 1; |
| 215 return true; | 217 return true; |
| 216 } | 218 } |
| 217 } | 219 } |
| 218 SetContentClient(&content_client_); | 220 SetContentClient(&content_client_); |
| 219 return false; | 221 return false; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() { | 340 ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() { |
| 339 renderer_client_.reset(base::CommandLine::ForCurrentProcess()->HasSwitch( | 341 renderer_client_.reset(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 340 switches::kRunLayoutTest) | 342 switches::kRunLayoutTest) |
| 341 ? new LayoutTestContentRendererClient | 343 ? new LayoutTestContentRendererClient |
| 342 : new ShellContentRendererClient); | 344 : new ShellContentRendererClient); |
| 343 | 345 |
| 344 return renderer_client_.get(); | 346 return renderer_client_.get(); |
| 345 } | 347 } |
| 346 | 348 |
| 347 } // namespace content | 349 } // namespace content |
| OLD | NEW |