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

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

Issue 7578002: Fix inverted ntp app display logic. (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // static 98 // static
99 bool AppLauncherHandler::IsAppExcludedFromList(const Extension* extension) { 99 bool AppLauncherHandler::IsAppExcludedFromList(const Extension* extension) {
100 // Don't include the WebStore and the Cloud Print app. 100 // Don't include the WebStore and the Cloud Print app.
101 // The WebStore launcher gets special treatment in ntp/apps.js. 101 // The WebStore launcher gets special treatment in ntp/apps.js.
102 // The Cloud Print app should never be displayed in the NTP. 102 // The Cloud Print app should never be displayed in the NTP.
103 bool ntp3 = 103 bool ntp3 =
104 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kNewTabPage4); 104 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kNewTabPage4);
105 if (!extension->is_app() || 105 if (!extension->is_app() ||
106 (ntp3 && extension->id() == extension_misc::kWebStoreAppId) || 106 (ntp3 && extension->id() == extension_misc::kWebStoreAppId) ||
107 (extension->id() == extension_misc::kCloudPrintAppId)) { 107 (extension->id() == extension_misc::kCloudPrintAppId)) {
108 return false; 108 return true;
109 } 109 }
110 return true; 110 return false;
111 } 111 }
112 112
113 void AppLauncherHandler::CreateAppInfo(const Extension* extension, 113 void AppLauncherHandler::CreateAppInfo(const Extension* extension,
114 const AppNotification* notification, 114 const AppNotification* notification,
115 ExtensionService* service, 115 ExtensionService* service,
116 DictionaryValue* value) { 116 DictionaryValue* value) {
117 bool enabled = service->IsExtensionEnabled(extension->id()) && 117 bool enabled = service->IsExtensionEnabled(extension->id()) &&
118 !service->GetTerminatedExtension(extension->id()); 118 !service->GetTerminatedExtension(extension->id());
119 GURL icon_big = 119 GURL icon_big =
120 ExtensionIconSource::GetIconURL(extension, 120 ExtensionIconSource::GetIconURL(extension,
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 901
902 void AppLauncherHandler::UninstallDefaultApps() { 902 void AppLauncherHandler::UninstallDefaultApps() {
903 AppsPromo* apps_promo = extension_service_->apps_promo(); 903 AppsPromo* apps_promo = extension_service_->apps_promo();
904 const ExtensionIdSet& app_ids = apps_promo->old_default_apps(); 904 const ExtensionIdSet& app_ids = apps_promo->old_default_apps();
905 for (ExtensionIdSet::const_iterator iter = app_ids.begin(); 905 for (ExtensionIdSet::const_iterator iter = app_ids.begin();
906 iter != app_ids.end(); ++iter) { 906 iter != app_ids.end(); ++iter) {
907 if (extension_service_->GetExtensionById(*iter, true)) 907 if (extension_service_->GetExtensionById(*iter, true))
908 extension_service_->UninstallExtension(*iter, false, NULL); 908 extension_service_->UninstallExtension(*iter, false, NULL);
909 } 909 }
910 } 910 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698