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

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

Issue 276573004: Bluetooth: Implement new socket API for Chrome OS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 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/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 BluetoothPairingChromeOS* BeginPairing( 92 BluetoothPairingChromeOS* BeginPairing(
93 BluetoothDevice::PairingDelegate* pairing_delegate); 93 BluetoothDevice::PairingDelegate* pairing_delegate);
94 94
95 // Releases the current pairing object, any pairing-related method calls will 95 // Releases the current pairing object, any pairing-related method calls will
96 // be ignored. 96 // be ignored.
97 void EndPairing(); 97 void EndPairing();
98 98
99 // Returns the current pairing object or NULL if no pairing is in progress. 99 // Returns the current pairing object or NULL if no pairing is in progress.
100 BluetoothPairingChromeOS* GetPairing() const; 100 BluetoothPairingChromeOS* GetPairing() const;
101 101
102 // Returns the object path of the device.
103 const dbus::ObjectPath& object_path() const { return object_path_; }
104
102 protected: 105 protected:
103 // BluetoothDevice override 106 // BluetoothDevice override
104 virtual std::string GetDeviceName() const OVERRIDE; 107 virtual std::string GetDeviceName() const OVERRIDE;
105 108
106 private: 109 private:
107 friend class BluetoothAdapterChromeOS; 110 friend class BluetoothAdapterChromeOS;
108 111
109 BluetoothDeviceChromeOS( 112 BluetoothDeviceChromeOS(
110 BluetoothAdapterChromeOS* adapter, 113 BluetoothAdapterChromeOS* adapter,
111 const dbus::ObjectPath& object_path, 114 const dbus::ObjectPath& object_path,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 const std::string& error_name, 159 const std::string& error_name,
157 const std::string& error_message); 160 const std::string& error_message);
158 161
159 // Called by dbus:: on failure of the D-Bus method call to unpair the device; 162 // Called by dbus:: on failure of the D-Bus method call to unpair the device;
160 // there is no matching completion call since this object is deleted in the 163 // there is no matching completion call since this object is deleted in the
161 // process of unpairing. 164 // process of unpairing.
162 void OnForgetError(const ErrorCallback& error_callback, 165 void OnForgetError(const ErrorCallback& error_callback,
163 const std::string& error_name, 166 const std::string& error_name,
164 const std::string& error_message); 167 const std::string& error_message);
165 168
166 // Called by dbus:: on completion of the D-Bus method call to
167 // connect a peofile.
168 void OnConnectProfile(device::BluetoothProfile* profile,
169 const base::Closure& callback);
170 void OnConnectProfileError(
171 device::BluetoothProfile* profile,
172 const ConnectToProfileErrorCallback& error_callback,
173 const std::string& error_name,
174 const std::string& error_message);
175
176 // Called by dbus:: on completion of the D-Bus method call to start the 169 // Called by dbus:: on completion of the D-Bus method call to start the
177 // connection monitor. 170 // connection monitor.
178 void OnStartConnectionMonitor(const base::Closure& callback); 171 void OnStartConnectionMonitor(const base::Closure& callback);
179 void OnStartConnectionMonitorError(const ErrorCallback& error_callback, 172 void OnStartConnectionMonitorError(const ErrorCallback& error_callback,
180 const std::string& error_name, 173 const std::string& error_name,
181 const std::string& error_message); 174 const std::string& error_message);
182 175
183 // Returns the object path of the device; used by BluetoothAdapterChromeOS
184 const dbus::ObjectPath& object_path() const { return object_path_; }
185
186 // The adapter that owns this device instance. 176 // The adapter that owns this device instance.
187 BluetoothAdapterChromeOS* adapter_; 177 BluetoothAdapterChromeOS* adapter_;
188 178
189 // The dbus object path of the device object. 179 // The dbus object path of the device object.
190 dbus::ObjectPath object_path_; 180 dbus::ObjectPath object_path_;
191 181
192 // List of observers interested in event notifications from us. 182 // List of observers interested in event notifications from us.
193 ObserverList<device::BluetoothDevice::Observer> observers_; 183 ObserverList<device::BluetoothDevice::Observer> observers_;
194 184
195 // Number of ongoing calls to Connect(). 185 // Number of ongoing calls to Connect().
(...skipping 15 matching lines...) Expand all
211 // Note: This should remain the last member so it'll be destroyed and 201 // Note: This should remain the last member so it'll be destroyed and
212 // invalidate its weak pointers before any other members are destroyed. 202 // invalidate its weak pointers before any other members are destroyed.
213 base::WeakPtrFactory<BluetoothDeviceChromeOS> weak_ptr_factory_; 203 base::WeakPtrFactory<BluetoothDeviceChromeOS> weak_ptr_factory_;
214 204
215 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceChromeOS); 205 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceChromeOS);
216 }; 206 };
217 207
218 } // namespace chromeos 208 } // namespace chromeos
219 209
220 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H 210 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698