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

Unified Diff: chrome/browser/ui/webui/ntp/app_launcher_handler.cc

Issue 7572029: ntp4: hook up 'no thanks' app promo link. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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/resources/ntp4/apps_page.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/ntp/app_launcher_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
index 8781dde93a589929bb125e8937e092d876efdcfc..43cd98b2fd5e34090e7af13a4edb74b7990e861c 100644
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -591,11 +591,20 @@ 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).
- ignore_changes_ = true;
- UninstallDefaultApps();
- extension_service_->apps_promo()->HidePromo();
- ignore_changes_ = false;
- HandleGetApps(NULL);
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kNewTabPage4)) {
+ UninstallDefaultApps();
+ extension_service_->apps_promo()->HidePromo();
+ } else {
+ // TODO(estade): remove all this. NTP3 uninstalled all the default apps then
+ // refreshed the entire NTP, we don't have to jump through these hoops for
+ // NTP4 because each app uninstall is handled separately without reloading
+ // the entire page.
+ ignore_changes_ = true;
+ UninstallDefaultApps();
+ extension_service_->apps_promo()->HidePromo();
+ ignore_changes_ = false;
+ HandleGetApps(NULL);
+ }
}
void AppLauncherHandler::HandleCreateAppShortcut(const ListValue* args) {
« no previous file with comments | « chrome/browser/resources/ntp4/apps_page.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698