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

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

Issue 7253001: Added a private chromeAuthPrivate API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 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
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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 default: 219 default:
220 NOTREACHED(); 220 NOTREACHED();
221 } 221 }
222 } 222 }
223 223
224 void AppLauncherHandler::FillAppDictionary(DictionaryValue* dictionary) { 224 void AppLauncherHandler::FillAppDictionary(DictionaryValue* dictionary) {
225 ListValue* list = new ListValue(); 225 ListValue* list = new ListValue();
226 const ExtensionList* extensions = extensions_service_->extensions(); 226 const ExtensionList* extensions = extensions_service_->extensions();
227 ExtensionList::const_iterator it; 227 ExtensionList::const_iterator it;
228 for (it = extensions->begin(); it != extensions->end(); ++it) { 228 for (it = extensions->begin(); it != extensions->end(); ++it) {
229 // Don't include the WebStore. 229 // Don't include the WebStore and the Cloud Print app.
230 // The WebStore launcher gets special treatment in ntp/apps.js. 230 // The WebStore launcher gets special treatment in ntp/apps.js.
231 // The Cloud Print app should not be displayed in the NTP.
231 if ((*it)->is_app() && 232 if ((*it)->is_app() &&
232 (*it)->id() != extension_misc::kWebStoreAppId) { 233 (*it)->id() != extension_misc::kWebStoreAppId &&
234 (*it)->id() != extension_misc::kCloudPrintAppId) {
233 DictionaryValue* app_info = new DictionaryValue(); 235 DictionaryValue* app_info = new DictionaryValue();
234 CreateAppInfo(*it, extensions_service_->extension_prefs(), app_info); 236 CreateAppInfo(*it, extensions_service_->extension_prefs(), app_info);
235 list->Append(app_info); 237 list->Append(app_info);
236 } 238 }
237 } 239 }
238 240
239 extensions = extensions_service_->disabled_extensions(); 241 extensions = extensions_service_->disabled_extensions();
240 for (it = extensions->begin(); it != extensions->end(); ++it) { 242 for (it = extensions->begin(); it != extensions->end(); ++it) {
241 if ((*it)->is_app() && 243 if ((*it)->is_app() &&
242 (*it)->id() != extension_misc::kWebStoreAppId) { 244 (*it)->id() != extension_misc::kWebStoreAppId &&
245 (*it)->id() != extension_misc::kCloudPrintAppId) {
243 DictionaryValue* app_info = new DictionaryValue(); 246 DictionaryValue* app_info = new DictionaryValue();
244 CreateAppInfo(*it, extensions_service_->extension_prefs(), app_info); 247 CreateAppInfo(*it, extensions_service_->extension_prefs(), app_info);
245 list->Append(app_info); 248 list->Append(app_info);
246 } 249 }
247 } 250 }
248 251
249 dictionary->Set("apps", list); 252 dictionary->Set("apps", list);
250 253
251 #if defined(OS_MACOSX) 254 #if defined(OS_MACOSX)
252 // App windows are not yet implemented on mac. 255 // App windows are not yet implemented on mac.
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 655
653 void AppLauncherHandler::UninstallDefaultApps() { 656 void AppLauncherHandler::UninstallDefaultApps() {
654 AppsPromo* apps_promo = extensions_service_->apps_promo(); 657 AppsPromo* apps_promo = extensions_service_->apps_promo();
655 const ExtensionIdSet& app_ids = apps_promo->old_default_apps(); 658 const ExtensionIdSet& app_ids = apps_promo->old_default_apps();
656 for (ExtensionIdSet::const_iterator iter = app_ids.begin(); 659 for (ExtensionIdSet::const_iterator iter = app_ids.begin();
657 iter != app_ids.end(); ++iter) { 660 iter != app_ids.end(); ++iter) {
658 if (extensions_service_->GetExtensionById(*iter, true)) 661 if (extensions_service_->GetExtensionById(*iter, true))
659 extensions_service_->UninstallExtension(*iter, false, NULL); 662 extensions_service_->UninstallExtension(*iter, false, NULL);
660 } 663 }
661 } 664 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698