Index: chrome/browser/extensions/api/permissions/permissions_api.cc |
diff --git a/chrome/browser/extensions/api/permissions/permissions_api.cc b/chrome/browser/extensions/api/permissions/permissions_api.cc |
index cbaf1d9055f362b27f2567d2e3381f4fe7008bc3..c87b7e43c7d221898217bb62ee9e124d8870d7eb 100644 |
--- a/chrome/browser/extensions/api/permissions/permissions_api.cc |
+++ b/chrome/browser/extensions/api/permissions/permissions_api.cc |
@@ -147,7 +147,9 @@ PermissionsRequestFunction::~PermissionsRequestFunction() {} |
bool PermissionsRequestFunction::RunImpl() { |
results_ = Request::Results::Create(false); |
- if (!user_gesture() && !ignore_user_gesture_for_tests) { |
+ if (!user_gesture() && |
+ !ignore_user_gesture_for_tests && |
+ extension_->location() != Manifest::COMPONENT) { |
error_ = kUserGestureRequiredError; |
return false; |
} |
@@ -209,8 +211,9 @@ bool PermissionsRequestFunction::RunImpl() { |
// We don't need to show the prompt if there are no new warnings, or if |
// we're skipping the confirmation UI. All extension types but INTERNAL |
// are allowed to silently increase their permission level. |
- bool has_no_warnings = requested_permissions_->GetWarningMessages( |
- GetExtension()->GetType()).empty(); |
+ bool has_no_warnings = extension_->location() == Manifest::COMPONENT || |
Matt Perry
2013/06/05 00:26:52
nit: this really belongs on the if statement below
vadimt
2013/06/05 00:33:07
Done.
|
+ requested_permissions_->GetWarningMessages( |
+ GetExtension()->GetType()).empty(); |
if (auto_confirm_for_tests == PROCEED || has_no_warnings) { |
InstallUIProceed(); |
} else if (auto_confirm_for_tests == ABORT) { |