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

Side by Side Diff: extensions/shell/common/shell_extensions_client.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
« no previous file with comments | « extensions/extensions_resources.grd ('k') | extensions/test/test_extensions_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "extensions/shell/common/shell_extensions_client.h" 5 #include "extensions/shell/common/shell_extensions_client.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "extensions/common/api/generated_schemas.h" 9 #include "extensions/common/api/generated_schemas.h"
10 #include "extensions/common/common_manifest_handlers.h" 10 #include "extensions/common/common_manifest_handlers.h"
11 #include "extensions/common/extension_urls.h" 11 #include "extensions/common/extension_urls.h"
12 #include "extensions/common/features/api_feature.h" 12 #include "extensions/common/features/api_feature.h"
13 #include "extensions/common/features/base_feature_provider.h" 13 #include "extensions/common/features/base_feature_provider.h"
14 #include "extensions/common/features/behavior_feature.h"
14 #include "extensions/common/features/json_feature_provider_source.h" 15 #include "extensions/common/features/json_feature_provider_source.h"
15 #include "extensions/common/features/manifest_feature.h" 16 #include "extensions/common/features/manifest_feature.h"
16 #include "extensions/common/features/permission_feature.h" 17 #include "extensions/common/features/permission_feature.h"
17 #include "extensions/common/features/simple_feature.h" 18 #include "extensions/common/features/simple_feature.h"
18 #include "extensions/common/manifest_handler.h" 19 #include "extensions/common/manifest_handler.h"
19 #include "extensions/common/permissions/permission_message_provider.h" 20 #include "extensions/common/permissions/permission_message_provider.h"
20 #include "extensions/common/permissions/permissions_info.h" 21 #include "extensions/common/permissions/permissions_info.h"
21 #include "extensions/common/permissions/permissions_provider.h" 22 #include "extensions/common/permissions/permissions_provider.h"
22 #include "extensions/common/url_pattern_set.h" 23 #include "extensions/common/url_pattern_set.h"
23 #include "extensions/shell/common/api/generated_schemas.h" 24 #include "extensions/shell/common/api/generated_schemas.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 CreateFeatureProviderSource(name)); 109 CreateFeatureProviderSource(name));
109 if (name == "api") { 110 if (name == "api") {
110 provider.reset(new BaseFeatureProvider(source->dictionary(), 111 provider.reset(new BaseFeatureProvider(source->dictionary(),
111 CreateFeature<APIFeature>)); 112 CreateFeature<APIFeature>));
112 } else if (name == "manifest") { 113 } else if (name == "manifest") {
113 provider.reset(new BaseFeatureProvider(source->dictionary(), 114 provider.reset(new BaseFeatureProvider(source->dictionary(),
114 CreateFeature<ManifestFeature>)); 115 CreateFeature<ManifestFeature>));
115 } else if (name == "permission") { 116 } else if (name == "permission") {
116 provider.reset(new BaseFeatureProvider(source->dictionary(), 117 provider.reset(new BaseFeatureProvider(source->dictionary(),
117 CreateFeature<PermissionFeature>)); 118 CreateFeature<PermissionFeature>));
119 } else if (name == "behavior") {
120 provider.reset(new BaseFeatureProvider(source->dictionary(),
121 CreateFeature<BehaviorFeature>));
118 } else { 122 } else {
119 NOTREACHED(); 123 NOTREACHED();
120 } 124 }
121 return provider.Pass(); 125 return provider.Pass();
122 } 126 }
123 127
124 scoped_ptr<JSONFeatureProviderSource> 128 scoped_ptr<JSONFeatureProviderSource>
125 ShellExtensionsClient::CreateFeatureProviderSource( 129 ShellExtensionsClient::CreateFeatureProviderSource(
126 const std::string& name) const { 130 const std::string& name) const {
127 scoped_ptr<JSONFeatureProviderSource> source( 131 scoped_ptr<JSONFeatureProviderSource> source(
128 new JSONFeatureProviderSource(name)); 132 new JSONFeatureProviderSource(name));
129 if (name == "api") { 133 if (name == "api") {
130 source->LoadJSON(IDR_EXTENSION_API_FEATURES); 134 source->LoadJSON(IDR_EXTENSION_API_FEATURES);
131 source->LoadJSON(IDR_SHELL_EXTENSION_API_FEATURES); 135 source->LoadJSON(IDR_SHELL_EXTENSION_API_FEATURES);
132 } else if (name == "manifest") { 136 } else if (name == "manifest") {
133 source->LoadJSON(IDR_EXTENSION_MANIFEST_FEATURES); 137 source->LoadJSON(IDR_EXTENSION_MANIFEST_FEATURES);
134 } else if (name == "permission") { 138 } else if (name == "permission") {
135 source->LoadJSON(IDR_EXTENSION_PERMISSION_FEATURES); 139 source->LoadJSON(IDR_EXTENSION_PERMISSION_FEATURES);
140 } else if (name == "behavior") {
141 source->LoadJSON(IDR_EXTENSION_BEHAVIOR_FEATURES);
136 } else { 142 } else {
137 NOTREACHED(); 143 NOTREACHED();
138 source.reset(); 144 source.reset();
139 } 145 }
140 return source.Pass(); 146 return source.Pass();
141 } 147 }
142 148
143 void ShellExtensionsClient::FilterHostPermissions( 149 void ShellExtensionsClient::FilterHostPermissions(
144 const URLPatternSet& hosts, 150 const URLPatternSet& hosts,
145 URLPatternSet* new_hosts, 151 URLPatternSet* new_hosts,
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 // any URL as a blacklist URL because we don't really care. 221 // any URL as a blacklist URL because we don't really care.
216 return true; 222 return true;
217 } 223 }
218 224
219 std::set<base::FilePath> ShellExtensionsClient::GetBrowserImagePaths( 225 std::set<base::FilePath> ShellExtensionsClient::GetBrowserImagePaths(
220 const Extension* extension) { 226 const Extension* extension) {
221 return std::set<base::FilePath>(); 227 return std::set<base::FilePath>();
222 } 228 }
223 229
224 } // namespace extensions 230 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/extensions_resources.grd ('k') | extensions/test/test_extensions_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698