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

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

Issue 13997002: Load extensions features file separately when needed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix merge conflicts Created 7 years, 8 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/common/extensions/extension.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/common/extensions/api/extension_api.h" 5 #include "chrome/common/extensions/api/extension_api.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 } 327 }
328 328
329 ExtensionAPI::ExtensionAPI() { 329 ExtensionAPI::ExtensionAPI() {
330 } 330 }
331 331
332 ExtensionAPI::~ExtensionAPI() { 332 ExtensionAPI::~ExtensionAPI() {
333 } 333 }
334 334
335 void ExtensionAPI::InitDefaultConfiguration() { 335 void ExtensionAPI::InitDefaultConfiguration() {
336 RegisterDependencyProvider( 336 RegisterDependencyProvider(
337 "api", BaseFeatureProvider::GetAPIFeatures()); 337 "api", BaseFeatureProvider::GetByName("api"));
338 RegisterDependencyProvider( 338 RegisterDependencyProvider(
339 "manifest", BaseFeatureProvider::GetManifestFeatures()); 339 "manifest", BaseFeatureProvider::GetByName("manifest"));
340 RegisterDependencyProvider( 340 RegisterDependencyProvider(
341 "permission", BaseFeatureProvider::GetPermissionFeatures()); 341 "permission", BaseFeatureProvider::GetByName("permission"));
342 342
343 // Schemas to be loaded from resources. 343 // Schemas to be loaded from resources.
344 CHECK(unloaded_schemas_.empty()); 344 CHECK(unloaded_schemas_.empty());
345 RegisterSchema("app", ReadFromResource( 345 RegisterSchema("app", ReadFromResource(
346 IDR_EXTENSION_API_JSON_APP)); 346 IDR_EXTENSION_API_JSON_APP));
347 RegisterSchema("browserAction", ReadFromResource( 347 RegisterSchema("browserAction", ReadFromResource(
348 IDR_EXTENSION_API_JSON_BROWSERACTION)); 348 IDR_EXTENSION_API_JSON_BROWSERACTION));
349 RegisterSchema("browsingData", ReadFromResource( 349 RegisterSchema("browsingData", ReadFromResource(
350 IDR_EXTENSION_API_JSON_BROWSINGDATA)); 350 IDR_EXTENSION_API_JSON_BROWSINGDATA));
351 RegisterSchema("commands", ReadFromResource( 351 RegisterSchema("commands", ReadFromResource(
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 return extension->required_permission_set()->HasAnyAccessToAPI(name) || 643 return extension->required_permission_set()->HasAnyAccessToAPI(name) ||
644 extension->optional_permission_set()->HasAnyAccessToAPI(name); 644 extension->optional_permission_set()->HasAnyAccessToAPI(name);
645 } 645 }
646 646
647 bool ExtensionAPI::IsPrivilegedAPI(const std::string& name) { 647 bool ExtensionAPI::IsPrivilegedAPI(const std::string& name) {
648 return completely_unprivileged_apis_.count(name) || 648 return completely_unprivileged_apis_.count(name) ||
649 partially_unprivileged_apis_.count(name); 649 partially_unprivileged_apis_.count(name);
650 } 650 }
651 651
652 } // namespace extensions 652 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698