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

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

Issue 345493002: Promotion of ephemeral apps now handles permission escalation correctly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 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 | « chrome/browser/apps/ephemeral_app_browsertest.cc ('k') | no next file » | 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 c4672140bf28790fdd3e13f17f5b42c14f965dbf..8dd3ed64ecf4f8656991ed9d41952b7e741303c1 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -2026,20 +2026,10 @@ void ExtensionService::PromoteEphemeralApp(
extension->id(), syncer::StringOrdinal());
}
- if (extension_prefs_->IsExtensionDisabled(extension->id()) &&
- !extension_prefs_->IsExtensionBlacklisted(extension->id())) {
- // If the extension is not blacklisted and was disabled due to permission
- // increase or user action only, we can enable it because the user was
- // prompted.
- extension_prefs_->RemoveDisableReason(
- extension->id(),
- Extension::DISABLE_PERMISSIONS_INCREASE);
- extension_prefs_->RemoveDisableReason(
- extension->id(),
- Extension::DISABLE_USER_ACTION);
- if (!extension_prefs_->GetDisableReasons(extension->id()))
- EnableExtension(extension->id());
- }
+ // Cached ephemeral apps may be updated and disabled due to permissions
+ // increase. The app can be enabled as the install was user-acknowledged.
+ if (extension_prefs_->DidExtensionEscalatePermissions(extension->id()))
+ GrantPermissionsAndEnableExtension(extension);
}
// Remove the ephemeral flags from the preferences.
« no previous file with comments | « chrome/browser/apps/ephemeral_app_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698