| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "extensions/common/features/feature_provider.h" | 5 #include "extensions/common/features/feature_provider.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 FeatureProviderMap; | 40 FeatureProviderMap; |
| 41 | 41 |
| 42 FeatureProviderMap feature_providers_; | 42 FeatureProviderMap feature_providers_; |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 base::LazyInstance<Static> g_static = LAZY_INSTANCE_INITIALIZER; | 45 base::LazyInstance<Static> g_static = LAZY_INSTANCE_INITIALIZER; |
| 46 | 46 |
| 47 } // namespace | 47 } // namespace |
| 48 | 48 |
| 49 // static | 49 // static |
| 50 FeatureProvider* FeatureProvider::GetByName(const std::string& name) { | 50 const FeatureProvider* FeatureProvider::GetByName(const std::string& name) { |
| 51 return g_static.Get().GetFeatures(name); | 51 return g_static.Get().GetFeatures(name); |
| 52 } | 52 } |
| 53 | 53 |
| 54 // static | 54 // static |
| 55 FeatureProvider* FeatureProvider::GetAPIFeatures() { | 55 const FeatureProvider* FeatureProvider::GetAPIFeatures() { |
| 56 return GetByName("api"); | 56 return GetByName("api"); |
| 57 } | 57 } |
| 58 | 58 |
| 59 // static | 59 // static |
| 60 FeatureProvider* FeatureProvider::GetManifestFeatures() { | 60 const FeatureProvider* FeatureProvider::GetManifestFeatures() { |
| 61 return GetByName("manifest"); | 61 return GetByName("manifest"); |
| 62 } | 62 } |
| 63 | 63 |
| 64 // static | 64 // static |
| 65 FeatureProvider* FeatureProvider::GetPermissionFeatures() { | 65 const FeatureProvider* FeatureProvider::GetPermissionFeatures() { |
| 66 return GetByName("permission"); | 66 return GetByName("permission"); |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace extensions | 69 } // namespace extensions |
| OLD | NEW |