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

Unified Diff: device/bluetooth/device.h

Issue 2401193002: bluetooth: Add Device service for chrome://bluetooth-internals. (Closed)
Patch Set: Fully qualify mojom import 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/bluetooth/adapter.cc ('k') | device/bluetooth/device.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/device.h
diff --git a/device/bluetooth/device.h b/device/bluetooth/device.h
new file mode 100644
index 0000000000000000000000000000000000000000..c82439e6c283ecb6e851e466061bedf060a18420
--- /dev/null
+++ b/device/bluetooth/device.h
@@ -0,0 +1,47 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef DEVICE_BLUETOOTH_DEVICE_H_
+#define DEVICE_BLUETOOTH_DEVICE_H_
+
+#include <string>
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "device/bluetooth/bluetooth_adapter.h"
+#include "device/bluetooth/bluetooth_device.h"
+#include "device/bluetooth/public/interfaces/device.mojom.h"
+
+namespace bluetooth {
+
+// Implementation of Mojo Device located in
+// device/bluetooth/public/interfaces/device.mojom.
+// It handles requests to interact with Bluetooth Device.
+// Uses the platform abstraction of device/bluetooth.
+class Device : public mojom::Device {
+ public:
+ Device(const std::string& address,
+ scoped_refptr<device::BluetoothAdapter> adapter);
+ ~Device() override;
+
+ // Creates a mojom::DeviceInfo using info from the given |device|.
+ static mojom::DeviceInfoPtr ConstructDeviceInfoStruct(
+ const device::BluetoothDevice* device);
+
+ // mojom::Device overrides:
+ void GetInfo(const GetInfoCallback& callback) override;
+
+ private:
+ // The address of the Bluetooth device.
+ std::string address_;
+
+ // The current BluetoothAdapter.
+ scoped_refptr<device::BluetoothAdapter> adapter_;
+
+ DISALLOW_COPY_AND_ASSIGN(Device);
+};
+
+} // namespace bluetooth
+
+#endif // DEVICE_BLUETOOTH_DEVICE_H_
« no previous file with comments | « device/bluetooth/adapter.cc ('k') | device/bluetooth/device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698