Revert "Fix broken channel icon in chrome://help on CrOS" and try again
[chromium-blink-merge.git] / extensions / browser / api / bluetooth_low_energy / bluetooth_low_energy_notify_session.cc
blobbe99781ad3071dfa7082d050c91d8f836c8ebd33
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_notify_session.h"
7 #include "base/lazy_instance.h"
9 namespace extensions {
11 static base::LazyInstance<BrowserContextKeyedAPIFactory<
12 ApiResourceManager<BluetoothLowEnergyNotifySession> > > g_factory =
13 LAZY_INSTANCE_INITIALIZER;
15 template <>
16 BrowserContextKeyedAPIFactory<
17 ApiResourceManager<BluetoothLowEnergyNotifySession> >*
18 ApiResourceManager<BluetoothLowEnergyNotifySession>::GetFactoryInstance() {
19 return g_factory.Pointer();
22 BluetoothLowEnergyNotifySession::BluetoothLowEnergyNotifySession(
23 bool persistent,
24 const std::string& owner_extension_id,
25 scoped_ptr<device::BluetoothGattNotifySession> session)
26 : ApiResource(owner_extension_id),
27 persistent_(persistent),
28 session_(session.release()) {
31 BluetoothLowEnergyNotifySession::~BluetoothLowEnergyNotifySession() {
34 device::BluetoothGattNotifySession*
35 BluetoothLowEnergyNotifySession::GetSession() const {
36 return session_.get();
39 bool BluetoothLowEnergyNotifySession::IsPersistent() const {
40 return persistent_;
43 } // namespace extensions