| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/extensions/api/hid/hid_device_resource.h" | 5 #include "chrome/browser/extensions/api/hid/hid_connection_resource.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/lazy_instance.h" |
| 11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 12 #include "device/hid/hid_connection.h" | 13 #include "device/hid/hid_connection.h" |
| 13 | 14 |
| 14 namespace extensions { | 15 namespace extensions { |
| 15 | 16 |
| 16 static base::LazyInstance<ProfileKeyedAPIFactory< | 17 static base::LazyInstance< |
| 17 ApiResourceManager<HidConnectionResource> > > | 18 ProfileKeyedAPIFactory<ApiResourceManager<HidConnectionResource> > > |
| 18 g_factory = LAZY_INSTANCE_INITIALIZER; | 19 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 19 | 20 |
| 20 // static | 21 // static |
| 21 template <> | 22 template <> |
| 22 ProfileKeyedAPIFactory<ApiResourceManager<HidConnectionResource> >* | 23 ProfileKeyedAPIFactory<ApiResourceManager<HidConnectionResource> >* |
| 23 ApiResourceManager<HidConnectionResource>::GetFactoryInstance() { | 24 ApiResourceManager<HidConnectionResource>::GetFactoryInstance() { |
| 24 return &g_factory.Get(); | 25 return &g_factory.Get(); |
| 25 } | 26 } |
| 26 | 27 |
| 27 HidConnectionResource::HidConnectionResource( | 28 HidConnectionResource::HidConnectionResource( |
| 28 const std::string& owner_extension_id, | 29 const std::string& owner_extension_id, |
| 29 scoped_refptr<device::HidConnection> connection) | 30 scoped_refptr<device::HidConnection> connection) |
| 30 : ApiResource(owner_extension_id), connection_(connection) {} | 31 : ApiResource(owner_extension_id), connection_(connection) {} |
| 31 | 32 |
| 32 HidConnectionResource::~HidConnectionResource() {} | 33 HidConnectionResource::~HidConnectionResource() {} |
| 33 | 34 |
| 34 } // namespace extensions | 35 } // namespace extensions |
| OLD | NEW |