OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1475 // and better error messages. (http://crbug.com/54013) | 1475 // and better error messages. (http://crbug.com/54013) |
1476 if (permission_str == kWebstorePrivatePermission && | 1476 if (permission_str == kWebstorePrivatePermission && |
1477 location_ != Extension::COMPONENT) { | 1477 location_ != Extension::COMPONENT) { |
1478 continue; | 1478 continue; |
1479 } | 1479 } |
1480 | 1480 |
1481 // Remap the old unlimited storage permission name. | 1481 // Remap the old unlimited storage permission name. |
1482 if (permission_str == kOldUnlimitedStoragePermission) | 1482 if (permission_str == kOldUnlimitedStoragePermission) |
1483 permission_str = kUnlimitedStoragePermission; | 1483 permission_str = kUnlimitedStoragePermission; |
1484 | 1484 |
1485 if (web_extent().is_empty()) { | 1485 if (web_extent().is_empty() || location() == Extension::COMPONENT) { |
1486 // Check if it's a module permission. If so, enable that permission. | 1486 // Check if it's a module permission. If so, enable that permission. |
1487 if (IsAPIPermission(permission_str)) { | 1487 if (IsAPIPermission(permission_str)) { |
1488 api_permissions_.push_back(permission_str); | 1488 api_permissions_.push_back(permission_str); |
1489 continue; | 1489 continue; |
1490 } | 1490 } |
1491 } else { | 1491 } else { |
1492 // Hosted apps only get access to a subset of the valid permissions. | 1492 // Hosted apps only get access to a subset of the valid permissions. |
1493 if (IsHostedAppPermission(permission_str)) { | 1493 if (IsHostedAppPermission(permission_str)) { |
1494 api_permissions_.push_back(permission_str); | 1494 api_permissions_.push_back(permission_str); |
1495 continue; | 1495 continue; |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1921 : extension_id(id), | 1921 : extension_id(id), |
1922 extension_path(path), | 1922 extension_path(path), |
1923 extension_location(location) { | 1923 extension_location(location) { |
1924 if (manifest) | 1924 if (manifest) |
1925 extension_manifest.reset( | 1925 extension_manifest.reset( |
1926 static_cast<DictionaryValue*>(manifest->DeepCopy())); | 1926 static_cast<DictionaryValue*>(manifest->DeepCopy())); |
1927 } | 1927 } |
1928 | 1928 |
1929 ExtensionInfo::~ExtensionInfo() { | 1929 ExtensionInfo::~ExtensionInfo() { |
1930 } | 1930 } |
OLD | NEW |