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

Side by Side Diff: device/bluetooth/bluetooth_device_chromeos.h

Issue 180163009: chrome.bluetooth API improvements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix ChromeOS Full build. Created 6 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
« no previous file with comments | « device/bluetooth/bluetooth_device.h ('k') | device/bluetooth/bluetooth_device_chromeos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H
6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 virtual void Disconnect( 50 virtual void Disconnect(
51 const base::Closure& callback, 51 const base::Closure& callback,
52 const ErrorCallback& error_callback) OVERRIDE; 52 const ErrorCallback& error_callback) OVERRIDE;
53 virtual void Forget(const ErrorCallback& error_callback) OVERRIDE; 53 virtual void Forget(const ErrorCallback& error_callback) OVERRIDE;
54 virtual void ConnectToService( 54 virtual void ConnectToService(
55 const device::BluetoothUUID& service_uuid, 55 const device::BluetoothUUID& service_uuid,
56 const SocketCallback& callback) OVERRIDE; 56 const SocketCallback& callback) OVERRIDE;
57 virtual void ConnectToProfile( 57 virtual void ConnectToProfile(
58 device::BluetoothProfile* profile, 58 device::BluetoothProfile* profile,
59 const base::Closure& callback, 59 const base::Closure& callback,
60 const ErrorCallback& error_callback) OVERRIDE; 60 const ConnectToProfileErrorCallback& error_callback) OVERRIDE;
61 virtual void SetOutOfBandPairingData( 61 virtual void SetOutOfBandPairingData(
62 const device::BluetoothOutOfBandPairingData& data, 62 const device::BluetoothOutOfBandPairingData& data,
63 const base::Closure& callback, 63 const base::Closure& callback,
64 const ErrorCallback& error_callback) OVERRIDE; 64 const ErrorCallback& error_callback) OVERRIDE;
65 virtual void ClearOutOfBandPairingData( 65 virtual void ClearOutOfBandPairingData(
66 const base::Closure& callback, 66 const base::Closure& callback,
67 const ErrorCallback& error_callback) OVERRIDE; 67 const ErrorCallback& error_callback) OVERRIDE;
68 68
69 // Creates a pairing object with the given delegate |pairing_delegate| and 69 // Creates a pairing object with the given delegate |pairing_delegate| and
70 // establishes it as the pairing context for this device. All pairing-related 70 // establishes it as the pairing context for this device. All pairing-related
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 // there is no matching completion call since this object is deleted in the 133 // there is no matching completion call since this object is deleted in the
134 // process of unpairing. 134 // process of unpairing.
135 void OnForgetError(const ErrorCallback& error_callback, 135 void OnForgetError(const ErrorCallback& error_callback,
136 const std::string& error_name, 136 const std::string& error_name,
137 const std::string& error_message); 137 const std::string& error_message);
138 138
139 // Called by dbus:: on completion of the D-Bus method call to 139 // Called by dbus:: on completion of the D-Bus method call to
140 // connect a peofile. 140 // connect a peofile.
141 void OnConnectProfile(device::BluetoothProfile* profile, 141 void OnConnectProfile(device::BluetoothProfile* profile,
142 const base::Closure& callback); 142 const base::Closure& callback);
143 void OnConnectProfileError(device::BluetoothProfile* profile, 143 void OnConnectProfileError(
144 const ErrorCallback& error_callback, 144 device::BluetoothProfile* profile,
145 const std::string& error_name, 145 const ConnectToProfileErrorCallback& error_callback,
146 const std::string& error_message); 146 const std::string& error_name,
147 const std::string& error_message);
147 148
148 // Returns the object path of the device; used by BluetoothAdapterChromeOS 149 // Returns the object path of the device; used by BluetoothAdapterChromeOS
149 const dbus::ObjectPath& object_path() const { return object_path_; } 150 const dbus::ObjectPath& object_path() const { return object_path_; }
150 151
151 // The adapter that owns this device instance. 152 // The adapter that owns this device instance.
152 BluetoothAdapterChromeOS* adapter_; 153 BluetoothAdapterChromeOS* adapter_;
153 154
154 // The dbus object path of the device object. 155 // The dbus object path of the device object.
155 dbus::ObjectPath object_path_; 156 dbus::ObjectPath object_path_;
156 157
157 // Number of ongoing calls to Connect(). 158 // Number of ongoing calls to Connect().
158 int num_connecting_calls_; 159 int num_connecting_calls_;
159 160
160 // During pairing this is set to an object that we don't own, but on which 161 // During pairing this is set to an object that we don't own, but on which
161 // we can make method calls to request, display or confirm PIN Codes and 162 // we can make method calls to request, display or confirm PIN Codes and
162 // Passkeys. Generally it is the object that owns this one. 163 // Passkeys. Generally it is the object that owns this one.
163 scoped_ptr<BluetoothPairingChromeOS> pairing_; 164 scoped_ptr<BluetoothPairingChromeOS> pairing_;
164 165
165 // Note: This should remain the last member so it'll be destroyed and 166 // Note: This should remain the last member so it'll be destroyed and
166 // invalidate its weak pointers before any other members are destroyed. 167 // invalidate its weak pointers before any other members are destroyed.
167 base::WeakPtrFactory<BluetoothDeviceChromeOS> weak_ptr_factory_; 168 base::WeakPtrFactory<BluetoothDeviceChromeOS> weak_ptr_factory_;
168 169
169 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceChromeOS); 170 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceChromeOS);
170 }; 171 };
171 172
172 } // namespace chromeos 173 } // namespace chromeos
173 174
174 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H 175 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_device.h ('k') | device/bluetooth/bluetooth_device_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698