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

Unified Diff: chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_connection.cc

Issue 349433002: chrome.bluetoothLowEnergy: Introduce connect and disconnect methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
Index: chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_connection.cc
diff --git a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_connection.cc b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_connection.cc
new file mode 100644
index 0000000000000000000000000000000000000000..cdcd4bbaa228c067838ad7b781e10e3e2ae072d6
--- /dev/null
+++ b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_connection.cc
@@ -0,0 +1,38 @@
+// Copyright 2014 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.
+
+#include "chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_connection.h"
+
+namespace extensions {
+
+static base::LazyInstance<BrowserContextKeyedAPIFactory<
+ ApiResourceManager<BluetoothLowEnergyConnection> > >
+ g_factory = LAZY_INSTANCE_INITIALIZER;
+
+template <>
+BrowserContextKeyedAPIFactory<
+ ApiResourceManager<BluetoothLowEnergyConnection> >*
+ApiResourceManager<BluetoothLowEnergyConnection>::GetFactoryInstance() {
+ return g_factory.Pointer();
+}
+
+BluetoothLowEnergyConnection::BluetoothLowEnergyConnection(
+ const std::string& owner_extension_id,
+ scoped_ptr<device::BluetoothGattConnection> connection)
+ : ApiResource(owner_extension_id),
+ connection_(connection.release()) {
+}
+
+BluetoothLowEnergyConnection::~BluetoothLowEnergyConnection() {}
+
+device::BluetoothGattConnection*
+BluetoothLowEnergyConnection::GetConnection() const {
+ return connection_.get();
+}
+
+bool BluetoothLowEnergyConnection::IsPersistent() const {
+ return true;
+}
keybuk 2014/06/19 17:23:49 I leave it up to kalman to decide whether having a
not at google - send to devlin 2014/06/19 17:27:09 I'm quite sure we do want this, it's important for
rpaquay 2014/06/19 19:07:26 Hmm... I don't quite know the use cases for this A
armansito 2014/06/19 21:58:34 After offline discussion with rpaquay@, I added an
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698