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

Side by Side Diff: chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_connection.cc

Issue 2370373002: Move chrome.bluetoothLowEnergy out of //chrome. (Closed)
Patch Set: 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
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energ y_connection.h"
6
7 #include "base/lazy_instance.h"
8
9 namespace extensions {
10
11 static base::LazyInstance<BrowserContextKeyedAPIFactory<
12 ApiResourceManager<BluetoothLowEnergyConnection> > > g_factory =
13 LAZY_INSTANCE_INITIALIZER;
14
15 template <>
16 BrowserContextKeyedAPIFactory<
17 ApiResourceManager<BluetoothLowEnergyConnection> >*
18 ApiResourceManager<BluetoothLowEnergyConnection>::GetFactoryInstance() {
19 return g_factory.Pointer();
20 }
21
22 BluetoothLowEnergyConnection::BluetoothLowEnergyConnection(
23 bool persistent,
24 const std::string& owner_extension_id,
25 std::unique_ptr<device::BluetoothGattConnection> connection)
26 : ApiResource(owner_extension_id),
27 persistent_(persistent),
28 connection_(connection.release()) {}
29
30 BluetoothLowEnergyConnection::~BluetoothLowEnergyConnection() {
31 }
32
33 device::BluetoothGattConnection*
34 BluetoothLowEnergyConnection::GetConnection() const {
35 return connection_.get();
36 }
37
38 bool BluetoothLowEnergyConnection::IsPersistent() const {
39 return persistent_;
40 }
41
42 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698