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

Side by Side Diff: components/arc/bluetooth/arc_bluetooth_bridge.h

Issue 2391973003: arc: bluetooth: Send update to Android when got DeviceChanged event (Closed)
Patch Set: rebase again Created 4 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
« no previous file with comments | « no previous file | components/arc/bluetooth/arc_bluetooth_bridge.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ 5 #ifndef COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_
6 #define COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ 6 #define COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 device::BluetoothAdvertisement::ErrorCode error_code); 326 device::BluetoothAdvertisement::ErrorCode error_code);
327 327
328 void OnGattNotifyStartDone( 328 void OnGattNotifyStartDone(
329 const RegisterForGattNotificationCallback& callback, 329 const RegisterForGattNotificationCallback& callback,
330 const std::string char_string_id, 330 const std::string char_string_id,
331 std::unique_ptr<device::BluetoothGattNotifySession> notify_session); 331 std::unique_ptr<device::BluetoothGattNotifySession> notify_session);
332 332
333 private: 333 private:
334 mojo::Array<mojom::BluetoothPropertyPtr> GetDeviceProperties( 334 mojo::Array<mojom::BluetoothPropertyPtr> GetDeviceProperties(
335 mojom::BluetoothPropertyType type, 335 mojom::BluetoothPropertyType type,
336 device::BluetoothDevice* device) const; 336 const device::BluetoothDevice* device) const;
337 mojo::Array<mojom::BluetoothPropertyPtr> GetAdapterProperties( 337 mojo::Array<mojom::BluetoothPropertyPtr> GetAdapterProperties(
338 mojom::BluetoothPropertyType type) const; 338 mojom::BluetoothPropertyType type) const;
339 mojo::Array<mojom::BluetoothAdvertisingDataPtr> GetAdvertisingData( 339 mojo::Array<mojom::BluetoothAdvertisingDataPtr> GetAdvertisingData(
340 device::BluetoothDevice* device) const; 340 const device::BluetoothDevice* device) const;
341 341
342 void SendCachedDevicesFound() const; 342 void SendCachedDevicesFound() const;
343 343
344 device::BluetoothRemoteGattCharacteristic* FindGattCharacteristic( 344 device::BluetoothRemoteGattCharacteristic* FindGattCharacteristic(
345 mojom::BluetoothAddressPtr remote_addr, 345 mojom::BluetoothAddressPtr remote_addr,
346 mojom::BluetoothGattServiceIDPtr service_id, 346 mojom::BluetoothGattServiceIDPtr service_id,
347 mojom::BluetoothGattIDPtr char_id) const; 347 mojom::BluetoothGattIDPtr char_id) const;
348 348
349 device::BluetoothRemoteGattDescriptor* FindGattDescriptor( 349 device::BluetoothRemoteGattDescriptor* FindGattDescriptor(
350 mojom::BluetoothAddressPtr remote_addr, 350 mojom::BluetoothAddressPtr remote_addr,
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 const ReleaseAdvertisementHandleCallback& callback, 421 const ReleaseAdvertisementHandleCallback& callback,
422 int32_t adv_handle); 422 int32_t adv_handle);
423 void OnUnregisterAdvertisementError( 423 void OnUnregisterAdvertisementError(
424 const ReleaseAdvertisementHandleCallback& callback, 424 const ReleaseAdvertisementHandleCallback& callback,
425 int32_t adv_handle, 425 int32_t adv_handle,
426 device::BluetoothAdvertisement::ErrorCode error_code); 426 device::BluetoothAdvertisement::ErrorCode error_code);
427 // Find the next free advertisement handle and put it in *adv_handle, 427 // Find the next free advertisement handle and put it in *adv_handle,
428 // or return false if the advertisement map is full. 428 // or return false if the advertisement map is full.
429 bool GetAdvertisementHandle(int32_t* adv_handle); 429 bool GetAdvertisementHandle(int32_t* adv_handle);
430 430
431 void SendDevice(const device::BluetoothDevice* device) const;
432
431 bool CalledOnValidThread(); 433 bool CalledOnValidThread();
432 434
433 mojo::Binding<mojom::BluetoothHost> binding_; 435 mojo::Binding<mojom::BluetoothHost> binding_;
434 436
435 scoped_refptr<bluez::BluetoothAdapterBlueZ> bluetooth_adapter_; 437 scoped_refptr<bluez::BluetoothAdapterBlueZ> bluetooth_adapter_;
436 scoped_refptr<device::BluetoothAdvertisement> advertisment_; 438 scoped_refptr<device::BluetoothAdvertisement> advertisment_;
437 std::unique_ptr<device::BluetoothDiscoverySession> discovery_session_; 439 std::unique_ptr<device::BluetoothDiscoverySession> discovery_session_;
438 std::unordered_map<std::string, 440 std::unordered_map<std::string,
439 std::unique_ptr<device::BluetoothGattNotifySession>> 441 std::unique_ptr<device::BluetoothGattNotifySession>>
440 notification_session_; 442 notification_session_;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 480
479 // WeakPtrFactory to use for callbacks. 481 // WeakPtrFactory to use for callbacks.
480 base::WeakPtrFactory<ArcBluetoothBridge> weak_factory_; 482 base::WeakPtrFactory<ArcBluetoothBridge> weak_factory_;
481 483
482 DISALLOW_COPY_AND_ASSIGN(ArcBluetoothBridge); 484 DISALLOW_COPY_AND_ASSIGN(ArcBluetoothBridge);
483 }; 485 };
484 486
485 } // namespace arc 487 } // namespace arc
486 488
487 #endif // COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ 489 #endif // COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_
OLDNEW
« no previous file with comments | « no previous file | components/arc/bluetooth/arc_bluetooth_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698