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

Side by Side Diff: chrome/browser/chromeos/dbus/dbus_thread_manager.cc

Issue 8233042: Chrome OS: Attach bluetooth UI to device discovery API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/dbus/dbus_thread_manager.h" 5 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/threading/thread.h" 8 #include "base/threading/thread.h"
9 #include "chrome/browser/chromeos/dbus/bluetooth_adapter_client.h"
10 #include "chrome/browser/chromeos/dbus/bluetooth_manager_client.h"
9 #include "chrome/browser/chromeos/dbus/cros_dbus_service.h" 11 #include "chrome/browser/chromeos/dbus/cros_dbus_service.h"
10 #include "chrome/browser/chromeos/dbus/session_manager_client.h" 12 #include "chrome/browser/chromeos/dbus/session_manager_client.h"
11 #include "chrome/browser/chromeos/dbus/power_manager_client.h" 13 #include "chrome/browser/chromeos/dbus/power_manager_client.h"
12 #include "chrome/browser/chromeos/dbus/sensors_source.h" 14 #include "chrome/browser/chromeos/dbus/sensors_source.h"
13 #include "chrome/browser/chromeos/dbus/speech_synthesizer_client.h" 15 #include "chrome/browser/chromeos/dbus/speech_synthesizer_client.h"
14 #include "chrome/common/chrome_switches.h" 16 #include "chrome/common/chrome_switches.h"
15 #include "dbus/bus.h" 17 #include "dbus/bus.h"
16 18
17 namespace chromeos { 19 namespace chromeos {
18 20
(...skipping 18 matching lines...) Expand all
37 cros_dbus_service_ = CrosDBusService::Create(system_bus_.get()); 39 cros_dbus_service_ = CrosDBusService::Create(system_bus_.get());
38 cros_dbus_service_->Start(); 40 cros_dbus_service_->Start();
39 41
40 // Start monitoring sensors if needed. 42 // Start monitoring sensors if needed.
41 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 43 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
42 if (command_line.HasSwitch(switches::kEnableSensors)) { 44 if (command_line.HasSwitch(switches::kEnableSensors)) {
43 sensors_source_.reset(new SensorsSource); 45 sensors_source_.reset(new SensorsSource);
44 sensors_source_->Init(system_bus_.get()); 46 sensors_source_->Init(system_bus_.get());
45 } 47 }
46 48
49 // Create bluetooth clients if bluetooth is enabled.
50 if (command_line.HasSwitch(switches::kEnableBluetooth)) {
51 bluetooth_manager_client_.reset(BluetoothManagerClient::Create(
52 system_bus_.get()));
53 CHECK(bluetooth_manager_client_.get() != NULL);
54
55 bluetooth_adapter_client_.reset(BluetoothAdapterClient::Create(
56 system_bus_.get()));
57 CHECK(bluetooth_adapter_client_.get() != NULL);
58 }
59
47 // Create the power manager client. 60 // Create the power manager client.
48 power_manager_client_.reset(PowerManagerClient::Create(system_bus_.get())); 61 power_manager_client_.reset(PowerManagerClient::Create(system_bus_.get()));
49 // Create the session manager client. 62 // Create the session manager client.
50 session_manager_client_.reset( 63 session_manager_client_.reset(
51 SessionManagerClient::Create(system_bus_.get())); 64 SessionManagerClient::Create(system_bus_.get()));
52 // Create the speech synthesizer client. 65 // Create the speech synthesizer client.
53 speech_synthesizer_client_.reset( 66 speech_synthesizer_client_.reset(
54 SpeechSynthesizerClient::Create(system_bus_.get())); 67 SpeechSynthesizerClient::Create(system_bus_.get()));
55 } 68 }
56 69
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 << "DBusThreadManager::Get() called before Initialize()"; 106 << "DBusThreadManager::Get() called before Initialize()";
94 return g_dbus_thread_manager; 107 return g_dbus_thread_manager;
95 } 108 }
96 109
97 void DBusThreadManager::set_session_manager_client_for_testing( 110 void DBusThreadManager::set_session_manager_client_for_testing(
98 SessionManagerClient* session_manager_client) { 111 SessionManagerClient* session_manager_client) {
99 session_manager_client_.reset(session_manager_client); 112 session_manager_client_.reset(session_manager_client);
100 } 113 }
101 114
102 } // namespace chromeos 115 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698