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

Side by Side Diff: chrome/browser/ui/webui/ntp/app_launcher_handler.cc

Issue 7662001: ntp4: remove apps promo 'no, thanks' link. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rbyers review 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/ntp4/new_tab.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" 5 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 ExtensionDialogAccepted(); 585 ExtensionDialogAccepted();
586 } else { 586 } else {
587 GetExtensionUninstallDialog()->ConfirmUninstall(this, extension); 587 GetExtensionUninstallDialog()->ConfirmUninstall(this, extension);
588 } 588 }
589 } 589 }
590 590
591 void AppLauncherHandler::HandleHideAppsPromo(const ListValue* args) { 591 void AppLauncherHandler::HandleHideAppsPromo(const ListValue* args) {
592 // If the user has intentionally hidden the promotion, we'll uninstall all the 592 // If the user has intentionally hidden the promotion, we'll uninstall all the
593 // default apps (we know the user hasn't installed any apps on their own at 593 // default apps (we know the user hasn't installed any apps on their own at
594 // this point, or the promotion wouldn't have been shown). 594 // this point, or the promotion wouldn't have been shown).
595 // TODO(estade): this isn't used right now as we sort out the future of the
596 // apps promo on ntp4.
595 if (NewTabUI::Ntp4Enabled()) { 597 if (NewTabUI::Ntp4Enabled()) {
596 UninstallDefaultApps(); 598 UninstallDefaultApps();
597 extension_service_->apps_promo()->HidePromo(); 599 extension_service_->apps_promo()->HidePromo();
598 } else { 600 } else {
599 // TODO(estade): remove all this. NTP3 uninstalled all the default apps then 601 // TODO(estade): remove all this. NTP3 uninstalled all the default apps then
600 // refreshed the entire NTP, we don't have to jump through these hoops for 602 // refreshed the entire NTP, we don't have to jump through these hoops for
601 // NTP4 because each app uninstall is handled separately without reloading 603 // NTP4 because each app uninstall is handled separately without reloading
602 // the entire page. 604 // the entire page.
603 ignore_changes_ = true; 605 ignore_changes_ = true;
604 UninstallDefaultApps(); 606 UninstallDefaultApps();
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 911
910 void AppLauncherHandler::UninstallDefaultApps() { 912 void AppLauncherHandler::UninstallDefaultApps() {
911 AppsPromo* apps_promo = extension_service_->apps_promo(); 913 AppsPromo* apps_promo = extension_service_->apps_promo();
912 const ExtensionIdSet& app_ids = apps_promo->old_default_apps(); 914 const ExtensionIdSet& app_ids = apps_promo->old_default_apps();
913 for (ExtensionIdSet::const_iterator iter = app_ids.begin(); 915 for (ExtensionIdSet::const_iterator iter = app_ids.begin();
914 iter != app_ids.end(); ++iter) { 916 iter != app_ids.end(); ++iter) {
915 if (extension_service_->GetExtensionById(*iter, true)) 917 if (extension_service_->GetExtensionById(*iter, true))
916 extension_service_->UninstallExtension(*iter, false, NULL); 918 extension_service_->UninstallExtension(*iter, false, NULL);
917 } 919 }
918 } 920 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/ntp4/new_tab.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698