Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Side by Side Diff: extensions/common/features/feature_provider.cc

Issue 789383002: Add the basic infrastructure for the Behavior feature type: BehaviorFeature and (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@flag-features
Patch Set: rebase Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 16 matching lines...) Expand all
27 friend struct base::DefaultLazyInstanceTraits<Static>; 27 friend struct base::DefaultLazyInstanceTraits<Static>;
28 28
29 Static() { 29 Static() {
30 ExtensionsClient* client = ExtensionsClient::Get(); 30 ExtensionsClient* client = ExtensionsClient::Get();
31 feature_providers_["api"] = 31 feature_providers_["api"] =
32 make_linked_ptr(client->CreateFeatureProvider("api").release()); 32 make_linked_ptr(client->CreateFeatureProvider("api").release());
33 feature_providers_["manifest"] = 33 feature_providers_["manifest"] =
34 make_linked_ptr(client->CreateFeatureProvider("manifest").release()); 34 make_linked_ptr(client->CreateFeatureProvider("manifest").release());
35 feature_providers_["permission"] = 35 feature_providers_["permission"] =
36 make_linked_ptr(client->CreateFeatureProvider("permission").release()); 36 make_linked_ptr(client->CreateFeatureProvider("permission").release());
37 feature_providers_["behavior"] =
38 make_linked_ptr(client->CreateFeatureProvider("behavior").release());
37 } 39 }
38 40
39 typedef std::map<std::string, linked_ptr<FeatureProvider> > 41 typedef std::map<std::string, linked_ptr<FeatureProvider> >
40 FeatureProviderMap; 42 FeatureProviderMap;
41 43
42 FeatureProviderMap feature_providers_; 44 FeatureProviderMap feature_providers_;
43 }; 45 };
44 46
45 base::LazyInstance<Static> g_static = LAZY_INSTANCE_INITIALIZER; 47 base::LazyInstance<Static> g_static = LAZY_INSTANCE_INITIALIZER;
46 48
(...skipping 12 matching lines...) Expand all
59 // static 61 // static
60 const FeatureProvider* FeatureProvider::GetManifestFeatures() { 62 const FeatureProvider* FeatureProvider::GetManifestFeatures() {
61 return GetByName("manifest"); 63 return GetByName("manifest");
62 } 64 }
63 65
64 // static 66 // static
65 const FeatureProvider* FeatureProvider::GetPermissionFeatures() { 67 const FeatureProvider* FeatureProvider::GetPermissionFeatures() {
66 return GetByName("permission"); 68 return GetByName("permission");
67 } 69 }
68 70
71 const FeatureProvider* FeatureProvider::GetBehaviorFeatures() {
72 return GetByName("behavior");
73 }
74
69 } // namespace extensions 75 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/features/feature_provider.h ('k') | extensions/common/features/simple_feature.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698