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" |
11 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
12 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
13 #include "base/threading/thread_restrictions.h" | 13 #include "base/threading/thread_restrictions.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
16 #include "content/public/browser/devtools_agent_host.h" | 16 #include "content/public/browser/devtools_agent_host.h" |
17 #include "content/public/browser/storage_partition.h" | 17 #include "content/public/browser/storage_partition.h" |
18 #include "content/public/common/content_switches.h" | 18 #include "content/public/common/content_switches.h" |
19 #include "content/public/common/main_function_params.h" | 19 #include "content/public/common/main_function_params.h" |
20 #include "content/public/common/url_constants.h" | 20 #include "content/public/common/url_constants.h" |
| 21 #include "content/shell/android/shell_descriptors.h" |
21 #include "content/shell/browser/shell.h" | 22 #include "content/shell/browser/shell.h" |
22 #include "content/shell/browser/shell_access_token_store.h" | 23 #include "content/shell/browser/shell_access_token_store.h" |
23 #include "content/shell/browser/shell_browser_context.h" | 24 #include "content/shell/browser/shell_browser_context.h" |
24 #include "content/shell/browser/shell_devtools_manager_delegate.h" | 25 #include "content/shell/browser/shell_devtools_manager_delegate.h" |
25 #include "content/shell/browser/shell_net_log.h" | 26 #include "content/shell/browser/shell_net_log.h" |
26 #include "content/shell/common/shell_switches.h" | 27 #include "content/shell/common/shell_switches.h" |
27 #include "device/bluetooth/bluetooth_adapter_factory.h" | 28 #include "device/bluetooth/bluetooth_adapter_factory.h" |
28 #include "device/geolocation/geolocation_delegate.h" | 29 #include "device/geolocation/geolocation_delegate.h" |
29 #include "device/geolocation/geolocation_provider.h" | 30 #include "device/geolocation/geolocation_provider.h" |
30 #include "net/base/filename_util.h" | 31 #include "net/base/filename_util.h" |
31 #include "net/base/net_module.h" | 32 #include "net/base/net_module.h" |
32 #include "net/grit/net_resources.h" | 33 #include "net/grit/net_resources.h" |
33 #include "ui/base/material_design/material_design_controller.h" | 34 #include "ui/base/material_design/material_design_controller.h" |
34 #include "ui/base/resource/resource_bundle.h" | 35 #include "ui/base/resource/resource_bundle.h" |
35 #include "url/gurl.h" | 36 #include "url/gurl.h" |
36 | 37 |
37 #if defined(OS_ANDROID) | 38 #if defined(OS_ANDROID) |
38 #include "base/message_loop/message_loop.h" | 39 #include "base/message_loop/message_loop.h" |
39 #include "components/crash/content/browser/crash_dump_manager_android.h" | 40 #include "components/crash/content/browser/crash_dump_manager_android.h" |
| 41 #include "components/crash/content/browser/crash_dump_observer_android.h" |
40 #include "net/android/network_change_notifier_factory_android.h" | 42 #include "net/android/network_change_notifier_factory_android.h" |
41 #include "net/base/network_change_notifier.h" | 43 #include "net/base/network_change_notifier.h" |
42 #endif | 44 #endif |
43 | 45 |
44 #if defined(USE_AURA) && defined(USE_X11) | 46 #if defined(USE_AURA) && defined(USE_X11) |
45 #include "ui/events/devices/x11/touch_factory_x11.h" // nogncheck | 47 #include "ui/events/devices/x11/touch_factory_x11.h" // nogncheck |
46 #endif | 48 #endif |
47 #if !defined(OS_CHROMEOS) && defined(USE_AURA) && defined(OS_LINUX) | 49 #if !defined(OS_CHROMEOS) && defined(USE_AURA) && defined(OS_LINUX) |
48 #include "ui/base/ime/input_method_initializer.h" | 50 #include "ui/base/ime/input_method_initializer.h" |
49 #endif | 51 #endif |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 void ShellBrowserMainParts::InitializeMessageLoopContext() { | 160 void ShellBrowserMainParts::InitializeMessageLoopContext() { |
159 ui::MaterialDesignController::Initialize(); | 161 ui::MaterialDesignController::Initialize(); |
160 Shell::CreateNewWindow(browser_context_.get(), | 162 Shell::CreateNewWindow(browser_context_.get(), |
161 GetStartupURL(), | 163 GetStartupURL(), |
162 NULL, | 164 NULL, |
163 gfx::Size()); | 165 gfx::Size()); |
164 } | 166 } |
165 | 167 |
166 #if defined(OS_ANDROID) | 168 #if defined(OS_ANDROID) |
167 int ShellBrowserMainParts::PreCreateThreads() { | 169 int ShellBrowserMainParts::PreCreateThreads() { |
| 170 breakpad::CrashDumpObserver::Create(); |
168 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 171 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
169 switches::kEnableCrashReporter)) { | 172 switches::kEnableCrashReporter)) { |
170 base::FilePath crash_dumps_dir = | 173 base::FilePath crash_dumps_dir = |
171 base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( | 174 base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( |
172 switches::kCrashDumpsDir); | 175 switches::kCrashDumpsDir); |
173 crash_dump_manager_.reset(new breakpad::CrashDumpManager(crash_dumps_dir)); | 176 breakpad::CrashDumpObserver::GetInstance()->RegisterClient( |
| 177 base::MakeUnique<breakpad::CrashDumpManager>( |
| 178 crash_dumps_dir, kAndroidMinidumpDescriptor)); |
174 } | 179 } |
175 | 180 |
176 return 0; | 181 return 0; |
177 } | 182 } |
178 #endif | 183 #endif |
179 | 184 |
180 void ShellBrowserMainParts::PreMainMessageLoopRun() { | 185 void ShellBrowserMainParts::PreMainMessageLoopRun() { |
181 net_log_.reset(new ShellNetLog("content_shell")); | 186 net_log_.reset(new ShellNetLog("content_shell")); |
182 InitializeBrowserContexts(); | 187 InitializeBrowserContexts(); |
183 device::GeolocationProvider::SetGeolocationDelegate( | 188 device::GeolocationProvider::SetGeolocationDelegate( |
(...skipping 25 matching lines...) Expand all Loading... |
209 device::BluetoothAdapterFactory::Shutdown(); | 214 device::BluetoothAdapterFactory::Shutdown(); |
210 bluez::BluezDBusManager::Shutdown(); | 215 bluez::BluezDBusManager::Shutdown(); |
211 chromeos::DBusThreadManager::Shutdown(); | 216 chromeos::DBusThreadManager::Shutdown(); |
212 #elif defined(OS_LINUX) | 217 #elif defined(OS_LINUX) |
213 device::BluetoothAdapterFactory::Shutdown(); | 218 device::BluetoothAdapterFactory::Shutdown(); |
214 bluez::DBusBluezManagerWrapperLinux::Shutdown(); | 219 bluez::DBusBluezManagerWrapperLinux::Shutdown(); |
215 #endif | 220 #endif |
216 } | 221 } |
217 | 222 |
218 } // namespace | 223 } // namespace |
OLD | NEW |