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

Side by Side Diff: device/bluetooth/bluetooth_device_experimental_chromeos.cc

Issue 14048007: Bluetooth: D-Bus client interface for org.bluez.Input1 (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: bt_experimental implemented + test Created 7 years, 8 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "device/bluetooth/bluetooth_device_experimental_chromeos.h" 5 #include "device/bluetooth/bluetooth_device_experimental_chromeos.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chromeos/dbus/dbus_thread_manager.h" 8 #include "chromeos/dbus/dbus_thread_manager.h"
9 #include "chromeos/dbus/experimental_bluetooth_adapter_client.h" 9 #include "chromeos/dbus/experimental_bluetooth_adapter_client.h"
10 #include "chromeos/dbus/experimental_bluetooth_agent_manager_client.h" 10 #include "chromeos/dbus/experimental_bluetooth_agent_manager_client.h"
11 #include "chromeos/dbus/experimental_bluetooth_agent_service_provider.h" 11 #include "chromeos/dbus/experimental_bluetooth_agent_service_provider.h"
12 #include "chromeos/dbus/experimental_bluetooth_device_client.h" 12 #include "chromeos/dbus/experimental_bluetooth_device_client.h"
13 #include "chromeos/dbus/experimental_bluetooth_input_client.h"
13 #include "dbus/bus.h" 14 #include "dbus/bus.h"
14 #include "device/bluetooth/bluetooth_adapter_experimental_chromeos.h" 15 #include "device/bluetooth/bluetooth_adapter_experimental_chromeos.h"
15 #include "device/bluetooth/bluetooth_socket.h" 16 #include "device/bluetooth/bluetooth_socket.h"
16 #include "third_party/cros_system_api/dbus/service_constants.h" 17 #include "third_party/cros_system_api/dbus/service_constants.h"
17 18
18 using device::BluetoothDevice; 19 using device::BluetoothDevice;
19 20
20 namespace { 21 namespace {
21 22
22 // The agent path is relatively meaningless since BlueZ only supports one 23 // The agent path is relatively meaningless since BlueZ only supports one
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 bool BluetoothDeviceExperimentalChromeOS::IsConnected() const { 81 bool BluetoothDeviceExperimentalChromeOS::IsConnected() const {
81 ExperimentalBluetoothDeviceClient::Properties* properties = 82 ExperimentalBluetoothDeviceClient::Properties* properties =
82 DBusThreadManager::Get()->GetExperimentalBluetoothDeviceClient()-> 83 DBusThreadManager::Get()->GetExperimentalBluetoothDeviceClient()->
83 GetProperties(object_path_); 84 GetProperties(object_path_);
84 DCHECK(properties); 85 DCHECK(properties);
85 86
86 return properties->connected.value(); 87 return properties->connected.value();
87 } 88 }
88 89
89 bool BluetoothDeviceExperimentalChromeOS::IsConnectable() const { 90 bool BluetoothDeviceExperimentalChromeOS::IsConnectable() const {
90 // TODO(deymo): implement 91 ExperimentalBluetoothInputClient::Properties* input_properties =
91 return false; 92 DBusThreadManager::Get()->GetExperimentalBluetoothInputClient()->
93 GetProperties(object_path_);
94 if (!input_properties)
keybuk 2013/04/18 20:50:25 This bit is worthy of a comment explaining why thi
deymo 2013/04/18 22:19:55 Done.
95 return true;
96
97 return input_properties->reconnect_mode.value() != "device";
92 } 98 }
93 99
94 bool BluetoothDeviceExperimentalChromeOS::IsConnecting() const { 100 bool BluetoothDeviceExperimentalChromeOS::IsConnecting() const {
95 return num_connecting_calls_ > 0; 101 return num_connecting_calls_ > 0;
96 } 102 }
97 103
98 BluetoothDeviceExperimentalChromeOS::ServiceList 104 BluetoothDeviceExperimentalChromeOS::ServiceList
99 BluetoothDeviceExperimentalChromeOS::GetServices() const { 105 BluetoothDeviceExperimentalChromeOS::GetServices() const {
100 ExperimentalBluetoothDeviceClient::Properties* properties = 106 ExperimentalBluetoothDeviceClient::Properties* properties =
101 DBusThreadManager::Get()->GetExperimentalBluetoothDeviceClient()-> 107 DBusThreadManager::Get()->GetExperimentalBluetoothDeviceClient()->
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 if (!confirmation_callback_.is_null()) { 606 if (!confirmation_callback_.is_null()) {
601 confirmation_callback_.Run(status); 607 confirmation_callback_.Run(status);
602 confirmation_callback_.Reset(); 608 confirmation_callback_.Reset();
603 callback_run = true; 609 callback_run = true;
604 } 610 }
605 611
606 return callback_run; 612 return callback_run;
607 } 613 }
608 614
609 } // namespace chromeos 615 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698