Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: extensions/shell/browser/shell_browser_main_parts.cc

Issue 1692723002: Add Bluez initialize call to startup for app_shell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comments. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « extensions/shell/browser/DEPS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #if defined(USE_AURA) 43 #if defined(USE_AURA)
44 #include "ui/aura/env.h" 44 #include "ui/aura/env.h"
45 #endif 45 #endif
46 46
47 #if defined(OS_CHROMEOS) 47 #if defined(OS_CHROMEOS)
48 #include "chromeos/audio/audio_devices_pref_handler_impl.h" 48 #include "chromeos/audio/audio_devices_pref_handler_impl.h"
49 #include "chromeos/audio/cras_audio_handler.h" 49 #include "chromeos/audio/cras_audio_handler.h"
50 #include "chromeos/dbus/dbus_thread_manager.h" 50 #include "chromeos/dbus/dbus_thread_manager.h"
51 #include "chromeos/disks/disk_mount_manager.h" 51 #include "chromeos/disks/disk_mount_manager.h"
52 #include "chromeos/network/network_handler.h" 52 #include "chromeos/network/network_handler.h"
53 #include "device/bluetooth/bluetooth_adapter_factory.h"
54 #include "device/bluetooth/dbus/bluez_dbus_manager.h"
53 #include "extensions/shell/browser/shell_audio_controller_chromeos.h" 55 #include "extensions/shell/browser/shell_audio_controller_chromeos.h"
54 #include "extensions/shell/browser/shell_network_controller_chromeos.h" 56 #include "extensions/shell/browser/shell_network_controller_chromeos.h"
55 #endif 57 #endif
56 58
57 #if defined(OS_MACOSX) 59 #if defined(OS_MACOSX)
58 #include "extensions/shell/browser/shell_browser_main_parts_mac.h" 60 #include "extensions/shell/browser/shell_browser_main_parts_mac.h"
59 #endif 61 #endif
60 62
61 #if !defined(DISABLE_NACL) 63 #if !defined(DISABLE_NACL)
62 #include "components/nacl/browser/nacl_browser.h" 64 #include "components/nacl/browser/nacl_browser.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 } 98 }
97 99
98 void ShellBrowserMainParts::PostMainMessageLoopStart() { 100 void ShellBrowserMainParts::PostMainMessageLoopStart() {
99 #if defined(OS_CHROMEOS) 101 #if defined(OS_CHROMEOS)
100 // Perform initialization of D-Bus objects here rather than in the below 102 // Perform initialization of D-Bus objects here rather than in the below
101 // helper classes so those classes' tests can initialize stub versions of the 103 // helper classes so those classes' tests can initialize stub versions of the
102 // D-Bus objects. 104 // D-Bus objects.
103 chromeos::DBusThreadManager::Initialize(); 105 chromeos::DBusThreadManager::Initialize();
104 chromeos::disks::DiskMountManager::Initialize(); 106 chromeos::disks::DiskMountManager::Initialize();
105 107
108 bluez::BluezDBusManager::Initialize(
109 chromeos::DBusThreadManager::Get()->GetSystemBus(),
110 chromeos::DBusThreadManager::Get()->IsUsingStub(
111 chromeos::DBusClientBundle::BLUETOOTH));
112
106 chromeos::NetworkHandler::Initialize(); 113 chromeos::NetworkHandler::Initialize();
107 network_controller_.reset(new ShellNetworkController( 114 network_controller_.reset(new ShellNetworkController(
108 base::CommandLine::ForCurrentProcess()->GetSwitchValueNative( 115 base::CommandLine::ForCurrentProcess()->GetSwitchValueNative(
109 switches::kAppShellPreferredNetwork))); 116 switches::kAppShellPreferredNetwork)));
110 117
111 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 118 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
112 switches::kAppShellAllowRoaming)) { 119 switches::kAppShellAllowRoaming)) {
113 network_controller_->SetCellularAllowRoaming(true); 120 network_controller_->SetCellularAllowRoaming(true);
114 } 121 }
115
116 #else 122 #else
117 // Non-Chrome OS platforms are for developer convenience, so use a test IME. 123 // Non-Chrome OS platforms are for developer convenience, so use a test IME.
118 ui::InitializeInputMethodForTesting(); 124 ui::InitializeInputMethodForTesting();
119 #endif 125 #endif
120 } 126 }
121 127
122 void ShellBrowserMainParts::PreEarlyInitialization() { 128 void ShellBrowserMainParts::PreEarlyInitialization() {
123 } 129 }
124 130
125 int ShellBrowserMainParts::PreCreateThreads() { 131 int ShellBrowserMainParts::PreCreateThreads() {
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 local_state_.reset(); 266 local_state_.reset();
261 267
262 browser_context_.reset(); 268 browser_context_.reset();
263 } 269 }
264 270
265 void ShellBrowserMainParts::PostDestroyThreads() { 271 void ShellBrowserMainParts::PostDestroyThreads() {
266 #if defined(OS_CHROMEOS) 272 #if defined(OS_CHROMEOS)
267 network_controller_.reset(); 273 network_controller_.reset();
268 chromeos::NetworkHandler::Shutdown(); 274 chromeos::NetworkHandler::Shutdown();
269 chromeos::disks::DiskMountManager::Shutdown(); 275 chromeos::disks::DiskMountManager::Shutdown();
276 device::BluetoothAdapterFactory::Shutdown();
277 bluez::BluezDBusManager::Shutdown();
270 chromeos::DBusThreadManager::Shutdown(); 278 chromeos::DBusThreadManager::Shutdown();
271 #endif 279 #endif
272 } 280 }
273 281
274 ExtensionsClient* ShellBrowserMainParts::CreateExtensionsClient() { 282 ExtensionsClient* ShellBrowserMainParts::CreateExtensionsClient() {
275 return new ShellExtensionsClient(); 283 return new ShellExtensionsClient();
276 } 284 }
277 285
278 ExtensionsBrowserClient* ShellBrowserMainParts::CreateExtensionsBrowserClient( 286 ExtensionsBrowserClient* ShellBrowserMainParts::CreateExtensionsBrowserClient(
279 content::BrowserContext* context, 287 content::BrowserContext* context,
280 PrefService* service) { 288 PrefService* service) {
281 return new ShellExtensionsBrowserClient(context, service); 289 return new ShellExtensionsBrowserClient(context, service);
282 } 290 }
283 291
284 void ShellBrowserMainParts::CreateExtensionSystem() { 292 void ShellBrowserMainParts::CreateExtensionSystem() {
285 DCHECK(browser_context_); 293 DCHECK(browser_context_);
286 extension_system_ = static_cast<ShellExtensionSystem*>( 294 extension_system_ = static_cast<ShellExtensionSystem*>(
287 ExtensionSystem::Get(browser_context_.get())); 295 ExtensionSystem::Get(browser_context_.get()));
288 extension_system_->InitForRegularProfile(true); 296 extension_system_->InitForRegularProfile(true);
289 } 297 }
290 298
291 } // namespace extensions 299 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/shell/browser/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698