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/shell_main_delegate.h" | 5 #include "content/shell/shell_main_delegate.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "content/public/browser/browser_main_runner.h" | 11 #include "content/public/browser/browser_main_runner.h" |
12 #include "content/public/common/content_switches.h" | 12 #include "content/public/common/content_switches.h" |
13 #include "content/public/common/url_constants.h" | 13 #include "content/public/common/url_constants.h" |
14 #include "content/shell/shell_browser_main.h" | 14 #include "content/shell/shell_browser_main.h" |
15 #include "content/shell/shell_content_browser_client.h" | 15 #include "content/shell/shell_content_browser_client.h" |
16 #include "content/shell/shell_content_renderer_client.h" | 16 #include "content/shell/shell_content_renderer_client.h" |
17 #include "content/shell/shell_switches.h" | 17 #include "content/shell/shell_switches.h" |
| 18 #include "content/shell/webkit_test_platform_support.h" |
18 #include "net/cookies/cookie_monster.h" | 19 #include "net/cookies/cookie_monster.h" |
19 #include "net/http/http_stream_factory.h" | 20 #include "net/http/http_stream_factory.h" |
20 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
21 #include "ui/base/ui_base_paths.h" | 22 #include "ui/base/ui_base_paths.h" |
22 | 23 |
23 #if defined(OS_ANDROID) | 24 #if defined(OS_ANDROID) |
24 #include "base/global_descriptors_posix.h" | 25 #include "base/global_descriptors_posix.h" |
25 #include "content/shell/android/shell_descriptors.h" | 26 #include "content/shell/android/shell_descriptors.h" |
26 #endif | 27 #endif |
27 | 28 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 #endif | 87 #endif |
87 | 88 |
88 InitLogging(); | 89 InitLogging(); |
89 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { | 90 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { |
90 CommandLine::ForCurrentProcess()->AppendSwitch( | 91 CommandLine::ForCurrentProcess()->AppendSwitch( |
91 switches::kAllowFileAccessFromFiles); | 92 switches::kAllowFileAccessFromFiles); |
92 CommandLine::ForCurrentProcess()->AppendSwitch( | 93 CommandLine::ForCurrentProcess()->AppendSwitch( |
93 switches::kForceCompositingMode); | 94 switches::kForceCompositingMode); |
94 //net::HttpStreamFactory::set_ignore_certificate_errors(true); | 95 //net::HttpStreamFactory::set_ignore_certificate_errors(true); |
95 net::CookieMonster::EnableFileScheme(); | 96 net::CookieMonster::EnableFileScheme(); |
| 97 if (!WebKitTestPlatformInitialize()) { |
| 98 if (exit_code) |
| 99 *exit_code = 1; |
| 100 return true; |
| 101 } |
96 } | 102 } |
97 SetContentClient(&content_client_); | 103 SetContentClient(&content_client_); |
98 return false; | 104 return false; |
99 } | 105 } |
100 | 106 |
101 void ShellMainDelegate::PreSandboxStartup() { | 107 void ShellMainDelegate::PreSandboxStartup() { |
102 #if defined(OS_MACOSX) | 108 #if defined(OS_MACOSX) |
103 OverrideFrameworkBundlePath(); | 109 OverrideFrameworkBundlePath(); |
104 OverrideChildProcessPath(); | 110 OverrideChildProcessPath(); |
105 #endif // OS_MACOSX | 111 #endif // OS_MACOSX |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 browser_client_.reset(new ShellContentBrowserClient); | 169 browser_client_.reset(new ShellContentBrowserClient); |
164 return browser_client_.get(); | 170 return browser_client_.get(); |
165 } | 171 } |
166 | 172 |
167 ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() { | 173 ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() { |
168 renderer_client_.reset(new ShellContentRendererClient); | 174 renderer_client_.reset(new ShellContentRendererClient); |
169 return renderer_client_.get(); | 175 return renderer_client_.get(); |
170 } | 176 } |
171 | 177 |
172 } // namespace content | 178 } // namespace content |
OLD | NEW |