Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2392)

Unified Diff: chrome/browser/extensions/api/permissions/permissions_api.cc

Issue 16085006: Allowing component extensions to request permissions NOT only from user's gestures (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moving check. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d39ab661c75f22e4bd5d18a6c67439ce924f2327 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;
}
@@ -211,7 +213,8 @@ bool PermissionsRequestFunction::RunImpl() {
// are allowed to silently increase their permission level.
bool has_no_warnings = requested_permissions_->GetWarningMessages(
GetExtension()->GetType()).empty();
- if (auto_confirm_for_tests == PROCEED || has_no_warnings) {
+ if (auto_confirm_for_tests == PROCEED || has_no_warnings ||
+ extension_->location() == Manifest::COMPONENT) {
InstallUIProceed();
} else if (auto_confirm_for_tests == ABORT) {
// Pretend the user clicked cancel.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698