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

Side by Side Diff: chrome/common/extensions/extension.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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "chrome/common/extensions/extension.h" 5 #include "chrome/common/extensions/extension.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 // know about aliases. 447 // know about aliases.
448 448
449 std::vector<std::string> host_data; 449 std::vector<std::string> host_data;
450 if (!APIPermissionSet::ParseFromJSON(permissions, api_permissions, 450 if (!APIPermissionSet::ParseFromJSON(permissions, api_permissions,
451 error, &host_data)) 451 error, &host_data))
452 return false; 452 return false;
453 453
454 // Verify feature availability of permissions. 454 // Verify feature availability of permissions.
455 std::vector<APIPermission::ID> to_remove; 455 std::vector<APIPermission::ID> to_remove;
456 FeatureProvider* permission_features = 456 FeatureProvider* permission_features =
457 BaseFeatureProvider::GetPermissionFeatures(); 457 BaseFeatureProvider::GetByName("permission");
458 for (APIPermissionSet::const_iterator it = api_permissions->begin(); 458 for (APIPermissionSet::const_iterator it = api_permissions->begin();
459 it != api_permissions->end(); ++it) { 459 it != api_permissions->end(); ++it) {
460 extensions::Feature* feature = 460 extensions::Feature* feature =
461 permission_features->GetFeature(it->name()); 461 permission_features->GetFeature(it->name());
462 462
463 // The feature should exist since we just got an APIPermission 463 // The feature should exist since we just got an APIPermission
464 // for it. The two systems should be updated together whenever a 464 // for it. The two systems should be updated together whenever a
465 // permission is added. 465 // permission is added.
466 DCHECK(feature); 466 DCHECK(feature);
467 // http://crbug.com/176381 467 // http://crbug.com/176381
(...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after
1803 1803
1804 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( 1804 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo(
1805 const Extension* extension, 1805 const Extension* extension,
1806 const PermissionSet* permissions, 1806 const PermissionSet* permissions,
1807 Reason reason) 1807 Reason reason)
1808 : reason(reason), 1808 : reason(reason),
1809 extension(extension), 1809 extension(extension),
1810 permissions(permissions) {} 1810 permissions(permissions) {}
1811 1811
1812 } // namespace extensions 1812 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/extension_api.cc ('k') | chrome/common/extensions/features/base_feature_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698