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

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 1150573002: Do not grant permissions to extensions that come in via Sync disabled due to a permission increase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sync_disable_reason
Patch Set: review Created 5 years, 7 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 | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index c066fd0f6d2c1e79f261c1fb10d46c3648e8e84b..cfac8a1fd7c126853b05eac8935fc2e1fa7395cf 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -539,6 +539,13 @@ bool ExtensionService::UpdateExtension(const extensions::CRXFileInfo& file,
creation_flags = pending_extension_info->creation_flags();
if (pending_extension_info->mark_acknowledged())
external_install_manager_->AcknowledgeExternalExtension(id);
+
+ // If the extension came in disabled due to a permission increase, then
+ // don't grant it all the permissions. crbug.com/484214
+ if (extensions::ExtensionPrefs::Get(profile_)->HasDisableReason(
+ id, Extension::DISABLE_PERMISSIONS_INCREASE)) {
+ installer->set_grant_permissions(false);
+ }
} else if (extension) {
installer->set_install_source(extension->location());
}
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698