Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / extensions / api / easy_unlock_private / easy_unlock_private_connection.cc
blob5e17d0cc5d18278feb42ef39465fa39056dcdc0e
1 // Copyright 2015 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 "chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_connection.h"
7 #include "base/lazy_instance.h"
8 #include "components/proximity_auth/connection.h"
10 namespace extensions {
12 static base::LazyInstance<BrowserContextKeyedAPIFactory<
13 ApiResourceManager<EasyUnlockPrivateConnection>>> g_factory =
14 LAZY_INSTANCE_INITIALIZER;
16 template <>
17 BrowserContextKeyedAPIFactory<ApiResourceManager<EasyUnlockPrivateConnection>>*
18 ApiResourceManager<EasyUnlockPrivateConnection>::GetFactoryInstance() {
19 return g_factory.Pointer();
22 EasyUnlockPrivateConnection::EasyUnlockPrivateConnection(
23 bool persistent,
24 const std::string& owner_extension_id,
25 scoped_ptr<proximity_auth::Connection> connection)
26 : ApiResource(owner_extension_id),
27 persistent_(persistent),
28 connection_(connection.release()) {}
30 EasyUnlockPrivateConnection::~EasyUnlockPrivateConnection() {}
32 proximity_auth::Connection* EasyUnlockPrivateConnection::GetConnection() const {
33 return connection_.get();
36 bool EasyUnlockPrivateConnection::IsPersistent() const {
37 return persistent_;
40 } // namespace extensions