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

Unified Diff: chrome/browser/dom_ui/app_launcher_handler.cc

Issue 3903002: Uninstall default apps if user hides promo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add DCHECK Created 10 years, 2 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/app/generated_resources.grd ('k') | chrome/browser/extensions/default_apps.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/app_launcher_handler.cc
diff --git a/chrome/browser/dom_ui/app_launcher_handler.cc b/chrome/browser/dom_ui/app_launcher_handler.cc
index 2da2ef67fc0f0ce85f2a6d94d7f3fe2690716529..89f2863cdc6bdb5b1fcba6be14f3d2a48e3c7264 100644
--- a/chrome/browser/dom_ui/app_launcher_handler.cc
+++ b/chrome/browser/dom_ui/app_launcher_handler.cc
@@ -268,6 +268,19 @@ void AppLauncherHandler::HandleUninstallApp(const ListValue* args) {
}
void AppLauncherHandler::HandleHideAppsPromo(const ListValue* args) {
+ // If the user has intentionally hidden the promotion, we'll uninstall all the
+ // default apps (we know the user hasn't installed any apps on their own at
+ // this point, or the promotion wouldn't have been shown).
+ DefaultApps* default_apps = extensions_service_->default_apps();
+ const ExtensionIdSet* app_ids = default_apps->GetDefaultApps();
+ DCHECK(*app_ids == extensions_service_->GetAppIds());
+
+ for (ExtensionIdSet::const_iterator iter = app_ids->begin();
+ iter != app_ids->end(); ++iter) {
+ if (extensions_service_->GetExtensionById(*iter, true))
+ extensions_service_->UninstallExtension(*iter, false);
+ }
+
extensions_service_->default_apps()->SetPromoHidden();
}
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/extensions/default_apps.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698