OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |