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_util.h" | 10 #include "base/file_util.h" |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 return ExtensionConfig::GetInstance()->whitelist(); | 430 return ExtensionConfig::GetInstance()->whitelist(); |
431 } | 431 } |
432 | 432 |
433 bool Extension::ParsePermissions(const char* key, | 433 bool Extension::ParsePermissions(const char* key, |
434 string16* error, | 434 string16* error, |
435 APIPermissionSet* api_permissions, | 435 APIPermissionSet* api_permissions, |
436 URLPatternSet* host_permissions) { | 436 URLPatternSet* host_permissions) { |
437 if (manifest_->HasKey(key)) { | 437 if (manifest_->HasKey(key)) { |
438 const ListValue* permissions = NULL; | 438 const ListValue* permissions = NULL; |
439 if (!manifest_->GetList(key, &permissions)) { | 439 if (!manifest_->GetList(key, &permissions)) { |
440 *error = ErrorUtils::FormatErrorMessageUTF16( | 440 *error = ErrorUtils::FormatErrorMessageUTF16(errors::kInvalidPermissions, |
441 errors::kInvalidPermissions, ""); | 441 std::string()); |
442 return false; | 442 return false; |
443 } | 443 } |
444 | 444 |
445 // NOTE: We need to get the APIPermission before we check if features | 445 // NOTE: We need to get the APIPermission before we check if features |
446 // associated with them are available because the feature system does not | 446 // associated with them are available because the feature system does not |
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)) |
(...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |