| OLD | NEW |
| (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 "extensions/browser/api/copresence_endpoints/copresence_endpoint_resour
ce.h" | |
| 6 | |
| 7 #include "base/lazy_instance.h" | |
| 8 #include "components/copresence_endpoints/public/copresence_endpoint.h" | |
| 9 #include "content/public/browser/browser_context.h" | |
| 10 | |
| 11 using copresence_endpoints::CopresenceEndpoint; | |
| 12 | |
| 13 namespace extensions { | |
| 14 | |
| 15 // CopresenceEndpointResource. | |
| 16 | |
| 17 // static | |
| 18 static base::LazyInstance<BrowserContextKeyedAPIFactory< | |
| 19 ApiResourceManager<CopresenceEndpointResource>>> g_endpoint_factory = | |
| 20 LAZY_INSTANCE_INITIALIZER; | |
| 21 | |
| 22 // static | |
| 23 template <> | |
| 24 BrowserContextKeyedAPIFactory<ApiResourceManager<CopresenceEndpointResource>>* | |
| 25 ApiResourceManager<CopresenceEndpointResource>::GetFactoryInstance() { | |
| 26 return g_endpoint_factory.Pointer(); | |
| 27 } | |
| 28 | |
| 29 CopresenceEndpointResource::CopresenceEndpointResource( | |
| 30 const std::string& owner_extension_id, | |
| 31 scoped_ptr<copresence_endpoints::CopresenceEndpoint> endpoint) | |
| 32 : ApiResource(owner_extension_id), endpoint_(endpoint.Pass()) { | |
| 33 } | |
| 34 | |
| 35 CopresenceEndpointResource::~CopresenceEndpointResource() { | |
| 36 } | |
| 37 | |
| 38 copresence_endpoints::CopresenceEndpoint* | |
| 39 CopresenceEndpointResource::endpoint() { | |
| 40 return endpoint_.get(); | |
| 41 } | |
| 42 | |
| 43 } // namespace extensions | |
| OLD | NEW |