| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser/shell_browser_main_parts.h" | 5 #include "content/shell/browser/shell_browser_main_parts.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 new ShellBrowserContext(true, net_log_.get())); | 139 new ShellBrowserContext(true, net_log_.get())); |
| 140 } | 140 } |
| 141 | 141 |
| 142 void ShellBrowserMainParts::InitializeMessageLoopContext() { | 142 void ShellBrowserMainParts::InitializeMessageLoopContext() { |
| 143 Shell::CreateNewWindow(browser_context_.get(), | 143 Shell::CreateNewWindow(browser_context_.get(), |
| 144 GetStartupURL(), | 144 GetStartupURL(), |
| 145 NULL, | 145 NULL, |
| 146 gfx::Size()); | 146 gfx::Size()); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void ShellBrowserMainParts::PreMainMessageLoopRun() { | |
| 150 #if defined(OS_ANDROID) | 149 #if defined(OS_ANDROID) |
| 150 int ShellBrowserMainParts::PreCreateThreads() { |
| 151 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 151 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 152 switches::kEnableCrashReporter)) { | 152 switches::kEnableCrashReporter)) { |
| 153 base::FilePath crash_dumps_dir = | 153 base::FilePath crash_dumps_dir = |
| 154 base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( | 154 base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( |
| 155 switches::kCrashDumpsDir); | 155 switches::kCrashDumpsDir); |
| 156 crash_dump_manager_.reset(new breakpad::CrashDumpManager(crash_dumps_dir)); | 156 crash_dump_manager_.reset(new breakpad::CrashDumpManager(crash_dumps_dir)); |
| 157 } | 157 } |
| 158 |
| 159 return 0; |
| 160 } |
| 158 #endif | 161 #endif |
| 159 | 162 |
| 163 void ShellBrowserMainParts::PreMainMessageLoopRun() { |
| 160 net_log_.reset(new ShellNetLog("content_shell")); | 164 net_log_.reset(new ShellNetLog("content_shell")); |
| 161 InitializeBrowserContexts(); | 165 InitializeBrowserContexts(); |
| 162 Shell::Initialize(); | 166 Shell::Initialize(); |
| 163 net::NetModule::SetResourceProvider(PlatformResourceProvider); | 167 net::NetModule::SetResourceProvider(PlatformResourceProvider); |
| 164 | 168 |
| 165 devtools_http_handler_.reset( | 169 devtools_http_handler_.reset( |
| 166 ShellDevToolsManagerDelegate::CreateHttpHandler(browser_context_.get())); | 170 ShellDevToolsManagerDelegate::CreateHttpHandler(browser_context_.get())); |
| 167 | 171 |
| 168 InitializeMessageLoopContext(); | 172 InitializeMessageLoopContext(); |
| 169 | 173 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 189 device::BluetoothAdapterFactory::Shutdown(); | 193 device::BluetoothAdapterFactory::Shutdown(); |
| 190 bluez::BluezDBusManager::Shutdown(); | 194 bluez::BluezDBusManager::Shutdown(); |
| 191 chromeos::DBusThreadManager::Shutdown(); | 195 chromeos::DBusThreadManager::Shutdown(); |
| 192 #elif defined(OS_LINUX) | 196 #elif defined(OS_LINUX) |
| 193 device::BluetoothAdapterFactory::Shutdown(); | 197 device::BluetoothAdapterFactory::Shutdown(); |
| 194 bluez::DBusBluezManagerWrapperLinux::Shutdown(); | 198 bluez::DBusBluezManagerWrapperLinux::Shutdown(); |
| 195 #endif | 199 #endif |
| 196 } | 200 } |
| 197 | 201 |
| 198 } // namespace | 202 } // namespace |
| OLD | NEW |