| 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 "components/devtools_http_handler/devtools_http_handler.h" | 15 #include "components/devtools_http_handler/devtools_http_handler.h" |
| 16 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.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" | |
| 22 #include "content/shell/browser/shell.h" | 21 #include "content/shell/browser/shell.h" |
| 23 #include "content/shell/browser/shell_access_token_store.h" | 22 #include "content/shell/browser/shell_access_token_store.h" |
| 24 #include "content/shell/browser/shell_browser_context.h" | 23 #include "content/shell/browser/shell_browser_context.h" |
| 25 #include "content/shell/browser/shell_devtools_manager_delegate.h" | 24 #include "content/shell/browser/shell_devtools_manager_delegate.h" |
| 26 #include "content/shell/browser/shell_net_log.h" | 25 #include "content/shell/browser/shell_net_log.h" |
| 27 #include "content/shell/common/shell_switches.h" | 26 #include "content/shell/common/shell_switches.h" |
| 28 #include "device/bluetooth/bluetooth_adapter_factory.h" | 27 #include "device/bluetooth/bluetooth_adapter_factory.h" |
| 29 #include "device/geolocation/geolocation_delegate.h" | 28 #include "device/geolocation/geolocation_delegate.h" |
| 30 #include "device/geolocation/geolocation_provider.h" | 29 #include "device/geolocation/geolocation_provider.h" |
| 31 #include "net/base/filename_util.h" | 30 #include "net/base/filename_util.h" |
| 32 #include "net/base/net_module.h" | 31 #include "net/base/net_module.h" |
| 33 #include "net/grit/net_resources.h" | 32 #include "net/grit/net_resources.h" |
| 34 #include "ui/base/material_design/material_design_controller.h" | 33 #include "ui/base/material_design/material_design_controller.h" |
| 35 #include "ui/base/resource/resource_bundle.h" | 34 #include "ui/base/resource/resource_bundle.h" |
| 36 #include "url/gurl.h" | 35 #include "url/gurl.h" |
| 37 | 36 |
| 38 #if defined(OS_ANDROID) | 37 #if defined(OS_ANDROID) |
| 39 #include "base/message_loop/message_loop.h" | 38 #include "base/message_loop/message_loop.h" |
| 40 #include "components/crash/content/browser/crash_dump_manager_android.h" | 39 #include "components/crash/content/browser/crash_dump_manager_android.h" |
| 41 #include "components/crash/content/browser/crash_dump_observer_android.h" | |
| 42 #include "net/android/network_change_notifier_factory_android.h" | 40 #include "net/android/network_change_notifier_factory_android.h" |
| 43 #include "net/base/network_change_notifier.h" | 41 #include "net/base/network_change_notifier.h" |
| 44 #endif | 42 #endif |
| 45 | 43 |
| 46 #if defined(USE_AURA) && defined(USE_X11) | 44 #if defined(USE_AURA) && defined(USE_X11) |
| 47 #include "ui/events/devices/x11/touch_factory_x11.h" // nogncheck | 45 #include "ui/events/devices/x11/touch_factory_x11.h" // nogncheck |
| 48 #endif | 46 #endif |
| 49 #if !defined(OS_CHROMEOS) && defined(USE_AURA) && defined(OS_LINUX) | 47 #if !defined(OS_CHROMEOS) && defined(USE_AURA) && defined(OS_LINUX) |
| 50 #include "ui/base/ime/input_method_initializer.h" | 48 #include "ui/base/ime/input_method_initializer.h" |
| 51 #endif | 49 #endif |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 109 |
| 112 ShellBrowserMainParts::ShellBrowserMainParts( | 110 ShellBrowserMainParts::ShellBrowserMainParts( |
| 113 const MainFunctionParams& parameters) | 111 const MainFunctionParams& parameters) |
| 114 : parameters_(parameters), | 112 : parameters_(parameters), |
| 115 run_message_loop_(true), | 113 run_message_loop_(true), |
| 116 devtools_http_handler_(nullptr) { | 114 devtools_http_handler_(nullptr) { |
| 117 } | 115 } |
| 118 | 116 |
| 119 ShellBrowserMainParts::~ShellBrowserMainParts() { | 117 ShellBrowserMainParts::~ShellBrowserMainParts() { |
| 120 DCHECK(!devtools_http_handler_); | 118 DCHECK(!devtools_http_handler_); |
| 121 #if defined(OS_ANDROID) | |
| 122 breakpad::CrashDumpObserver::GetInstance()->UnregisterClient( | |
| 123 crash_dump_manager_.get()); | |
| 124 #endif | |
| 125 } | 119 } |
| 126 | 120 |
| 127 #if !defined(OS_MACOSX) | 121 #if !defined(OS_MACOSX) |
| 128 void ShellBrowserMainParts::PreMainMessageLoopStart() { | 122 void ShellBrowserMainParts::PreMainMessageLoopStart() { |
| 129 #if defined(USE_AURA) && defined(USE_X11) | 123 #if defined(USE_AURA) && defined(USE_X11) |
| 130 ui::TouchFactory::SetTouchDeviceListFromCommandLine(); | 124 ui::TouchFactory::SetTouchDeviceListFromCommandLine(); |
| 131 #endif | 125 #endif |
| 132 } | 126 } |
| 133 #endif | 127 #endif |
| 134 | 128 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 gfx::Size()); | 166 gfx::Size()); |
| 173 } | 167 } |
| 174 | 168 |
| 175 #if defined(OS_ANDROID) | 169 #if defined(OS_ANDROID) |
| 176 int ShellBrowserMainParts::PreCreateThreads() { | 170 int ShellBrowserMainParts::PreCreateThreads() { |
| 177 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 171 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 178 switches::kEnableCrashReporter)) { | 172 switches::kEnableCrashReporter)) { |
| 179 base::FilePath crash_dumps_dir = | 173 base::FilePath crash_dumps_dir = |
| 180 base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( | 174 base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( |
| 181 switches::kCrashDumpsDir); | 175 switches::kCrashDumpsDir); |
| 182 crash_dump_manager_ = base::MakeUnique<breakpad::CrashDumpManager>( | 176 crash_dump_manager_.reset(new breakpad::CrashDumpManager(crash_dumps_dir)); |
| 183 crash_dumps_dir, kAndroidMinidumpDescriptor); | |
| 184 breakpad::CrashDumpObserver::GetInstance()->RegisterClient( | |
| 185 crash_dump_manager_.get()); | |
| 186 } | 177 } |
| 187 | 178 |
| 188 return 0; | 179 return 0; |
| 189 } | 180 } |
| 190 #endif | 181 #endif |
| 191 | 182 |
| 192 void ShellBrowserMainParts::PreMainMessageLoopRun() { | 183 void ShellBrowserMainParts::PreMainMessageLoopRun() { |
| 193 net_log_.reset(new ShellNetLog("content_shell")); | 184 net_log_.reset(new ShellNetLog("content_shell")); |
| 194 InitializeBrowserContexts(); | 185 InitializeBrowserContexts(); |
| 195 device::GeolocationProvider::SetGeolocationDelegate( | 186 device::GeolocationProvider::SetGeolocationDelegate( |
| (...skipping 28 matching lines...) Expand all Loading... |
| 224 device::BluetoothAdapterFactory::Shutdown(); | 215 device::BluetoothAdapterFactory::Shutdown(); |
| 225 bluez::BluezDBusManager::Shutdown(); | 216 bluez::BluezDBusManager::Shutdown(); |
| 226 chromeos::DBusThreadManager::Shutdown(); | 217 chromeos::DBusThreadManager::Shutdown(); |
| 227 #elif defined(OS_LINUX) | 218 #elif defined(OS_LINUX) |
| 228 device::BluetoothAdapterFactory::Shutdown(); | 219 device::BluetoothAdapterFactory::Shutdown(); |
| 229 bluez::DBusBluezManagerWrapperLinux::Shutdown(); | 220 bluez::DBusBluezManagerWrapperLinux::Shutdown(); |
| 230 #endif | 221 #endif |
| 231 } | 222 } |
| 232 | 223 |
| 233 } // namespace | 224 } // namespace |
| OLD | NEW |