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 "net/cookies/cookie_monster.h" | 18 #include "net/cookies/cookie_monster.h" |
19 #include "net/http/http_stream_factory.h" | |
20 #include "ui/base/resource/resource_bundle.h" | 19 #include "ui/base/resource/resource_bundle.h" |
21 #include "ui/base/ui_base_paths.h" | 20 #include "ui/base/ui_base_paths.h" |
22 | 21 |
23 #if defined(OS_ANDROID) | 22 #if defined(OS_ANDROID) |
24 #include "base/global_descriptors_posix.h" | 23 #include "base/global_descriptors_posix.h" |
25 #include "content/shell/android/shell_descriptors.h" | 24 #include "content/shell/android/shell_descriptors.h" |
26 #endif | 25 #endif |
27 | 26 |
28 #if defined(OS_MACOSX) | 27 #if defined(OS_MACOSX) |
29 #include "content/shell/paths_mac.h" | 28 #include "content/shell/paths_mac.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // Enable trace control and transport through event tracing for Windows. | 83 // Enable trace control and transport through event tracing for Windows. |
85 logging::LogEventProvider::Initialize(kContentShellProviderName); | 84 logging::LogEventProvider::Initialize(kContentShellProviderName); |
86 #endif | 85 #endif |
87 | 86 |
88 InitLogging(); | 87 InitLogging(); |
89 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { | 88 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { |
90 CommandLine::ForCurrentProcess()->AppendSwitch( | 89 CommandLine::ForCurrentProcess()->AppendSwitch( |
91 switches::kAllowFileAccessFromFiles); | 90 switches::kAllowFileAccessFromFiles); |
92 CommandLine::ForCurrentProcess()->AppendSwitch( | 91 CommandLine::ForCurrentProcess()->AppendSwitch( |
93 switches::kForceCompositingMode); | 92 switches::kForceCompositingMode); |
94 //net::HttpStreamFactory::set_ignore_certificate_errors(true); | |
95 net::CookieMonster::EnableFileScheme(); | 93 net::CookieMonster::EnableFileScheme(); |
96 } | 94 } |
97 SetContentClient(&content_client_); | 95 SetContentClient(&content_client_); |
98 return false; | 96 return false; |
99 } | 97 } |
100 | 98 |
101 void ShellMainDelegate::PreSandboxStartup() { | 99 void ShellMainDelegate::PreSandboxStartup() { |
102 #if defined(OS_MACOSX) | 100 #if defined(OS_MACOSX) |
103 OverrideFrameworkBundlePath(); | 101 OverrideFrameworkBundlePath(); |
104 OverrideChildProcessPath(); | 102 OverrideChildProcessPath(); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 browser_client_.reset(new ShellContentBrowserClient); | 161 browser_client_.reset(new ShellContentBrowserClient); |
164 return browser_client_.get(); | 162 return browser_client_.get(); |
165 } | 163 } |
166 | 164 |
167 ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() { | 165 ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() { |
168 renderer_client_.reset(new ShellContentRendererClient); | 166 renderer_client_.reset(new ShellContentRendererClient); |
169 return renderer_client_.get(); | 167 return renderer_client_.get(); |
170 } | 168 } |
171 | 169 |
172 } // namespace content | 170 } // namespace content |
OLD | NEW |