| OLD | NEW |
| 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_path.h" | 10 #include "base/file_path.h" |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 FeatureProvider* permission_features = | 594 FeatureProvider* permission_features = |
| 595 BaseFeatureProvider::GetPermissionFeatures(); | 595 BaseFeatureProvider::GetPermissionFeatures(); |
| 596 for (APIPermissionSet::const_iterator it = api_permissions->begin(); | 596 for (APIPermissionSet::const_iterator it = api_permissions->begin(); |
| 597 it != api_permissions->end(); ++it) { | 597 it != api_permissions->end(); ++it) { |
| 598 extensions::Feature* feature = | 598 extensions::Feature* feature = |
| 599 permission_features->GetFeature(it->name()); | 599 permission_features->GetFeature(it->name()); |
| 600 | 600 |
| 601 // The feature should exist since we just got an APIPermission | 601 // The feature should exist since we just got an APIPermission |
| 602 // for it. The two systems should be updated together whenever a | 602 // for it. The two systems should be updated together whenever a |
| 603 // permission is added. | 603 // permission is added. |
| 604 CHECK(feature); | 604 DCHECK(feature); |
| 605 // http://crbug.com/176381 |
| 606 if (!feature) |
| 607 continue; |
| 605 | 608 |
| 606 Feature::Availability availability = | 609 Feature::Availability availability = |
| 607 feature->IsAvailableToManifest( | 610 feature->IsAvailableToManifest( |
| 608 id(), | 611 id(), |
| 609 GetType(), | 612 GetType(), |
| 610 Feature::ConvertLocation(location()), | 613 Feature::ConvertLocation(location()), |
| 611 manifest_version()); | 614 manifest_version()); |
| 612 if (!availability.is_available()) { | 615 if (!availability.is_available()) { |
| 613 // Don't fail, but warn the developer that the manifest contains | 616 // Don't fail, but warn the developer that the manifest contains |
| 614 // unrecognized permissions. This may happen legitimately if the | 617 // unrecognized permissions. This may happen legitimately if the |
| (...skipping 2112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2727 | 2730 |
| 2728 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 2731 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
| 2729 const Extension* extension, | 2732 const Extension* extension, |
| 2730 const PermissionSet* permissions, | 2733 const PermissionSet* permissions, |
| 2731 Reason reason) | 2734 Reason reason) |
| 2732 : reason(reason), | 2735 : reason(reason), |
| 2733 extension(extension), | 2736 extension(extension), |
| 2734 permissions(permissions) {} | 2737 permissions(permissions) {} |
| 2735 | 2738 |
| 2736 } // namespace extensions | 2739 } // namespace extensions |
| OLD | NEW |