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

Side by Side Diff: extensions/common/extension_api.cc

Issue 2470193002: Introduce networking.onc as an alias for networkingPrivate (Closed)
Patch Set: allow optional permission Created 4 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/extension_api.h" 5 #include "extensions/common/extension_api.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 schemas_[schema_namespace] = std::move(schema_dict); 150 schemas_[schema_namespace] = std::move(schema_dict);
151 } 151 }
152 152
153 ExtensionAPI::ExtensionAPI() : default_configuration_initialized_(false) { 153 ExtensionAPI::ExtensionAPI() : default_configuration_initialized_(false) {
154 } 154 }
155 155
156 ExtensionAPI::~ExtensionAPI() { 156 ExtensionAPI::~ExtensionAPI() {
157 } 157 }
158 158
159 void ExtensionAPI::InitDefaultConfiguration() { 159 void ExtensionAPI::InitDefaultConfiguration() {
160 const char* names[] = {"api", "manifest", "permission"}; 160 const char* names[] = {"api", "behavior", "manifest", "permission"};
161 for (size_t i = 0; i < arraysize(names); ++i) 161 for (size_t i = 0; i < arraysize(names); ++i)
162 RegisterDependencyProvider(names[i], FeatureProvider::GetByName(names[i])); 162 RegisterDependencyProvider(names[i], FeatureProvider::GetByName(names[i]));
163 163
164 default_configuration_initialized_ = true; 164 default_configuration_initialized_ = true;
165 } 165 }
166 166
167 void ExtensionAPI::RegisterDependencyProvider(const std::string& name, 167 void ExtensionAPI::RegisterDependencyProvider(const std::string& name,
168 const FeatureProvider* provider) { 168 const FeatureProvider* provider) {
169 dependency_providers_[name] = provider; 169 dependency_providers_[name] = provider;
170 } 170 }
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 if (!alias_feature) 355 if (!alias_feature)
356 alias_feature = provider->second->GetFeature(alias); 356 alias_feature = provider->second->GetFeature(alias);
357 357
358 CHECK(alias_feature) << "Cannot find alias feature " << alias 358 CHECK(alias_feature) << "Cannot find alias feature " << alias
359 << " for API feature " << feature->name(); 359 << " for API feature " << feature->name();
360 360
361 return alias_feature->IsAvailableToContext(extension, context, url); 361 return alias_feature->IsAvailableToContext(extension, context, url);
362 } 362 }
363 363
364 } // namespace extensions 364 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/api/_permission_features.json ('k') | extensions/common/features/behavior_feature.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698