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.
5 #include "extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_connection.h"
7 #include "base/lazy_instance.h"
11 static base::LazyInstance
<BrowserContextKeyedAPIFactory
<
12 ApiResourceManager
<BluetoothLowEnergyConnection
> > > g_factory
=
13 LAZY_INSTANCE_INITIALIZER
;
16 BrowserContextKeyedAPIFactory
<
17 ApiResourceManager
<BluetoothLowEnergyConnection
> >*
18 ApiResourceManager
<BluetoothLowEnergyConnection
>::GetFactoryInstance() {
19 return g_factory
.Pointer();
22 BluetoothLowEnergyConnection::BluetoothLowEnergyConnection(
24 const std::string
& owner_extension_id
,
25 scoped_ptr
<device::BluetoothGattConnection
> connection
)
26 : ApiResource(owner_extension_id
),
27 persistent_(persistent
),
28 connection_(connection
.release()) {
31 BluetoothLowEnergyConnection::~BluetoothLowEnergyConnection() {
34 device::BluetoothGattConnection
*
35 BluetoothLowEnergyConnection::GetConnection() const {
36 return connection_
.get();
39 bool BluetoothLowEnergyConnection::IsPersistent() const {
43 } // namespace extensions