Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
|
armansito
2015/05/08 22:46:13
nit: s/2014/2015/
rkc
2015/05/11 21:59:35
Done.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef EXTENSIONS_BROWSER_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_API_ADVERTISEMENT_ H_ | |
| 6 #define EXTENSIONS_BROWSER_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_API_ADVERTISEMENT_ H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "device/bluetooth/bluetooth_advertisement.h" | |
| 11 #include "extensions/browser/api/api_resource.h" | |
| 12 #include "extensions/browser/api/api_resource_manager.h" | |
| 13 #include "extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event _router.h" | |
| 14 | |
| 15 namespace device { | |
| 16 class BluetoothAdvertisement; | |
| 17 } | |
|
armansito
2015/05/08 22:46:13
nit: "} // namespace device"
rkc
2015/05/11 21:59:35
Done.
| |
| 18 | |
| 19 namespace apibtle = extensions::core_api::bluetooth_low_energy; | |
| 20 | |
| 21 namespace extensions { | |
| 22 | |
| 23 // Representation of advertisement instances from the "bluetooth" namespace, | |
| 24 // abstracting away platform differences from the underlying | |
| 25 // BluetoothAdvertisementXxx class. All methods must be called on the | |
|
armansito
2015/05/08 22:46:13
Probably no need to mention "platform differences"
rkc
2015/05/11 21:59:35
Done.
| |
| 26 // |kThreadId| thread. | |
| 27 class BluetoothApiAdvertisement : public ApiResource { | |
| 28 public: | |
| 29 BluetoothApiAdvertisement(const std::string& owner_extension_id, | |
| 30 scoped_refptr<device::BluetoothAdvertisement>); | |
| 31 ~BluetoothApiAdvertisement() override; | |
| 32 | |
| 33 device::BluetoothAdvertisement* advertisement() { | |
| 34 return advertisement_.get(); | |
| 35 } | |
| 36 | |
| 37 // Platform specific implementations of |BluetoothAdvertisement| require | |
| 38 // being called on the UI thread. | |
|
armansito
2015/05/08 22:46:13
Again, since there is no platform magic happening
rkc
2015/05/11 21:59:34
Done.
| |
| 39 static const content::BrowserThread::ID kThreadId = | |
| 40 content::BrowserThread::UI; | |
| 41 | |
| 42 private: | |
| 43 friend class ApiResourceManager<BluetoothApiAdvertisement>; | |
| 44 | |
| 45 static const char* service_name() { | |
| 46 return "BluetoothApiAdvertisementManager"; | |
| 47 } | |
| 48 | |
| 49 // The underlying advertisement instance. | |
| 50 scoped_refptr<device::BluetoothAdvertisement> advertisement_; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(BluetoothApiAdvertisement); | |
| 53 }; | |
| 54 | |
| 55 } // namespace extensions | |
| 56 | |
| 57 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_API_ADVERTISEME NT_H_ | |
| OLD | NEW |