| Index: chrome/common/extensions/extension.cc
|
| diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
|
| index 9fc73cddc592eb3b1f50d7e7fd7359cfb470bd16..f222b0bffd66c0b3b405594023377795157f27c9 100644
|
| --- a/chrome/common/extensions/extension.cc
|
| +++ b/chrome/common/extensions/extension.cc
|
| @@ -2835,12 +2835,13 @@ bool Extension::ImplicitlyDelaysNetworkStartup() const {
|
| bool Extension::CanSpecifyAPIPermission(
|
| const ExtensionAPIPermission* permission,
|
| string16* error) const {
|
| - if (permission->is_component_only()) {
|
| - if (!CanSpecifyComponentOnlyPermission()) {
|
| - *error = ExtensionErrorUtils::FormatErrorMessageUTF16(
|
| - errors::kPermissionNotAllowed, permission->name());
|
| - return false;
|
| - }
|
| + if ((permission->is_component_only() &&
|
| + location_ != COMPONENT) ||
|
| + (permission->should_enforce_whitelist() &&
|
| + !permission->IsWhitelisted(id_))) {
|
| + *error = ExtensionErrorUtils::FormatErrorMessageUTF16(
|
| + errors::kPermissionNotAllowed, permission->name());
|
| + return false;
|
| }
|
|
|
| if (permission->id() == ExtensionAPIPermission::kExperimental) {
|
| @@ -2892,13 +2893,6 @@ bool Extension::CanSpecifyAPIPermission(
|
| return true;
|
| }
|
|
|
| -bool Extension::CanSpecifyComponentOnlyPermission() const {
|
| - // Only COMPONENT extensions can use private APIs.
|
| - // TODO(asargent) - We want a more general purpose mechanism for this,
|
| - // and better error messages. (http://crbug.com/54013)
|
| - return location_ == Extension::COMPONENT;
|
| -}
|
| -
|
| bool Extension::CanSpecifyExperimentalPermission() const {
|
| if (location_ == Extension::COMPONENT)
|
| return true;
|
|
|