Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/shell/browser/shell_browser_main_parts.h" | 5 #include "extensions/shell/browser/shell_browser_main_parts.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "components/devtools_http_handler/devtools_http_handler.h" | 12 #include "components/devtools_http_handler/devtools_http_handler.h" |
| 13 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 13 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 14 #include "components/prefs/pref_service.h" | 14 #include "components/prefs/pref_service.h" |
| 15 #include "components/storage_monitor/storage_monitor.h" | 15 #include "components/storage_monitor/storage_monitor.h" |
| 16 #include "components/update_client/update_query_params.h" | 16 #include "components/update_client/update_query_params.h" |
| 17 #include "content/public/browser/child_process_security_policy.h" | 17 #include "content/public/browser/child_process_security_policy.h" |
| 18 #include "content/public/browser/context_factory.h" | 18 #include "content/public/browser/context_factory.h" |
| 19 #include "content/public/common/result_codes.h" | 19 #include "content/public/common/result_codes.h" |
| 20 #include "content/shell/browser/shell_devtools_manager_delegate.h" | 20 #include "content/shell/browser/shell_devtools_manager_delegate.h" |
| 21 #include "device/bluetooth/bluetooth_adapter_factory.h" | |
|
James Cook
2016/02/11 23:17:59
Put this in the OS_CHROMEOS block below.
drustsmith
2016/02/11 23:39:29
Done.
| |
| 21 #include "extensions/browser/app_window/app_window_client.h" | 22 #include "extensions/browser/app_window/app_window_client.h" |
| 22 #include "extensions/browser/browser_context_keyed_service_factories.h" | 23 #include "extensions/browser/browser_context_keyed_service_factories.h" |
| 23 #include "extensions/browser/extension_system.h" | 24 #include "extensions/browser/extension_system.h" |
| 24 #include "extensions/browser/updater/update_service.h" | 25 #include "extensions/browser/updater/update_service.h" |
| 25 #include "extensions/common/constants.h" | 26 #include "extensions/common/constants.h" |
| 26 #include "extensions/common/switches.h" | 27 #include "extensions/common/switches.h" |
| 27 #include "extensions/shell/browser/shell_browser_context.h" | 28 #include "extensions/shell/browser/shell_browser_context.h" |
| 28 #include "extensions/shell/browser/shell_browser_context_keyed_service_factories .h" | 29 #include "extensions/shell/browser/shell_browser_context_keyed_service_factories .h" |
| 29 #include "extensions/shell/browser/shell_browser_main_delegate.h" | 30 #include "extensions/shell/browser/shell_browser_main_delegate.h" |
| 30 #include "extensions/shell/browser/shell_desktop_controller_aura.h" | 31 #include "extensions/shell/browser/shell_desktop_controller_aura.h" |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 47 #if defined(OS_CHROMEOS) | 48 #if defined(OS_CHROMEOS) |
| 48 #include "chromeos/audio/audio_devices_pref_handler_impl.h" | 49 #include "chromeos/audio/audio_devices_pref_handler_impl.h" |
| 49 #include "chromeos/audio/cras_audio_handler.h" | 50 #include "chromeos/audio/cras_audio_handler.h" |
| 50 #include "chromeos/dbus/dbus_thread_manager.h" | 51 #include "chromeos/dbus/dbus_thread_manager.h" |
| 51 #include "chromeos/disks/disk_mount_manager.h" | 52 #include "chromeos/disks/disk_mount_manager.h" |
| 52 #include "chromeos/network/network_handler.h" | 53 #include "chromeos/network/network_handler.h" |
| 53 #include "extensions/shell/browser/shell_audio_controller_chromeos.h" | 54 #include "extensions/shell/browser/shell_audio_controller_chromeos.h" |
| 54 #include "extensions/shell/browser/shell_network_controller_chromeos.h" | 55 #include "extensions/shell/browser/shell_network_controller_chromeos.h" |
| 55 #endif | 56 #endif |
| 56 | 57 |
| 58 #if defined(OS_CHROMEOS) | |
| 59 #include "device/bluetooth/dbus/bluez_dbus_manager.h" | |
|
James Cook
2016/02/11 23:17:59
Put this in the OS_CHROMEOS block above.
drustsmith
2016/02/11 23:39:29
Done.
| |
| 60 #endif | |
| 61 | |
| 57 #if defined(OS_MACOSX) | 62 #if defined(OS_MACOSX) |
| 58 #include "extensions/shell/browser/shell_browser_main_parts_mac.h" | 63 #include "extensions/shell/browser/shell_browser_main_parts_mac.h" |
| 59 #endif | 64 #endif |
| 60 | 65 |
| 61 #if !defined(DISABLE_NACL) | 66 #if !defined(DISABLE_NACL) |
| 62 #include "components/nacl/browser/nacl_browser.h" | 67 #include "components/nacl/browser/nacl_browser.h" |
| 63 #include "components/nacl/browser/nacl_process_host.h" | 68 #include "components/nacl/browser/nacl_process_host.h" |
| 64 #include "content/public/browser/browser_thread.h" | 69 #include "content/public/browser/browser_thread.h" |
| 65 #include "extensions/shell/browser/shell_nacl_browser_delegate.h" | 70 #include "extensions/shell/browser/shell_nacl_browser_delegate.h" |
| 66 #endif | 71 #endif |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 106 chromeos::NetworkHandler::Initialize(); | 111 chromeos::NetworkHandler::Initialize(); |
| 107 network_controller_.reset(new ShellNetworkController( | 112 network_controller_.reset(new ShellNetworkController( |
| 108 base::CommandLine::ForCurrentProcess()->GetSwitchValueNative( | 113 base::CommandLine::ForCurrentProcess()->GetSwitchValueNative( |
| 109 switches::kAppShellPreferredNetwork))); | 114 switches::kAppShellPreferredNetwork))); |
| 110 | 115 |
| 111 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 116 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 112 switches::kAppShellAllowRoaming)) { | 117 switches::kAppShellAllowRoaming)) { |
| 113 network_controller_->SetCellularAllowRoaming(true); | 118 network_controller_->SetCellularAllowRoaming(true); |
| 114 } | 119 } |
| 115 | 120 |
| 121 bluez::BluezDBusManager::Initialize( | |
|
James Cook
2016/02/11 23:17:58
It probably doesn't matter, but since the other CL
drustsmith
2016/02/11 23:39:29
Done.
| |
| 122 chromeos::DBusThreadManager::Get()->GetSystemBus(), | |
| 123 chromeos::DBusThreadManager::Get()->IsUsingStub( | |
| 124 chromeos::DBusClientBundle::BLUETOOTH)); | |
| 116 #else | 125 #else |
| 117 // Non-Chrome OS platforms are for developer convenience, so use a test IME. | 126 // Non-Chrome OS platforms are for developer convenience, so use a test IME. |
| 118 ui::InitializeInputMethodForTesting(); | 127 ui::InitializeInputMethodForTesting(); |
| 119 #endif | 128 #endif |
| 120 } | 129 } |
| 121 | 130 |
| 122 void ShellBrowserMainParts::PreEarlyInitialization() { | 131 void ShellBrowserMainParts::PreEarlyInitialization() { |
| 123 } | 132 } |
| 124 | 133 |
| 125 int ShellBrowserMainParts::PreCreateThreads() { | 134 int ShellBrowserMainParts::PreCreateThreads() { |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 260 local_state_.reset(); | 269 local_state_.reset(); |
| 261 | 270 |
| 262 browser_context_.reset(); | 271 browser_context_.reset(); |
| 263 } | 272 } |
| 264 | 273 |
| 265 void ShellBrowserMainParts::PostDestroyThreads() { | 274 void ShellBrowserMainParts::PostDestroyThreads() { |
| 266 #if defined(OS_CHROMEOS) | 275 #if defined(OS_CHROMEOS) |
| 267 network_controller_.reset(); | 276 network_controller_.reset(); |
| 268 chromeos::NetworkHandler::Shutdown(); | 277 chromeos::NetworkHandler::Shutdown(); |
| 269 chromeos::disks::DiskMountManager::Shutdown(); | 278 chromeos::disks::DiskMountManager::Shutdown(); |
| 279 device::BluetoothAdapterFactory::Shutdown(); | |
| 280 bluez::BluezDBusManager::Shutdown(); | |
| 270 chromeos::DBusThreadManager::Shutdown(); | 281 chromeos::DBusThreadManager::Shutdown(); |
| 271 #endif | 282 #endif |
| 272 } | 283 } |
| 273 | 284 |
| 274 ExtensionsClient* ShellBrowserMainParts::CreateExtensionsClient() { | 285 ExtensionsClient* ShellBrowserMainParts::CreateExtensionsClient() { |
| 275 return new ShellExtensionsClient(); | 286 return new ShellExtensionsClient(); |
| 276 } | 287 } |
| 277 | 288 |
| 278 ExtensionsBrowserClient* ShellBrowserMainParts::CreateExtensionsBrowserClient( | 289 ExtensionsBrowserClient* ShellBrowserMainParts::CreateExtensionsBrowserClient( |
| 279 content::BrowserContext* context, | 290 content::BrowserContext* context, |
| 280 PrefService* service) { | 291 PrefService* service) { |
| 281 return new ShellExtensionsBrowserClient(context, service); | 292 return new ShellExtensionsBrowserClient(context, service); |
| 282 } | 293 } |
| 283 | 294 |
| 284 void ShellBrowserMainParts::CreateExtensionSystem() { | 295 void ShellBrowserMainParts::CreateExtensionSystem() { |
| 285 DCHECK(browser_context_); | 296 DCHECK(browser_context_); |
| 286 extension_system_ = static_cast<ShellExtensionSystem*>( | 297 extension_system_ = static_cast<ShellExtensionSystem*>( |
| 287 ExtensionSystem::Get(browser_context_.get())); | 298 ExtensionSystem::Get(browser_context_.get())); |
| 288 extension_system_->InitForRegularProfile(true); | 299 extension_system_->InitForRegularProfile(true); |
| 289 } | 300 } |
| 290 | 301 |
| 291 } // namespace extensions | 302 } // namespace extensions |
| OLD | NEW |