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

Unified Diff: chrome/browser/dom_ui/app_launcher_handler.cc

Issue 6040005: More cleanup of DefaultApps code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove unnecessary change, add comments Created 9 years, 12 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
Index: chrome/browser/dom_ui/app_launcher_handler.cc
diff --git a/chrome/browser/dom_ui/app_launcher_handler.cc b/chrome/browser/dom_ui/app_launcher_handler.cc
index 64d128a2bc51b119e8f7108539f2169e0897b930..58ee56fc5489b492e9a70e588ef9049e71be6114 100644
--- a/chrome/browser/dom_ui/app_launcher_handler.cc
+++ b/chrome/browser/dom_ui/app_launcher_handler.cc
@@ -193,15 +193,10 @@ void AppLauncherHandler::FillAppDictionary(DictionaryValue* dictionary) {
dictionary->SetBoolean("disableCreateAppShortcut", true);
#endif
- // We always show the launcher on Chrome OS. On Desktop Chrome, only show it
- // if we've installed our default apps.
-#if defined(OS_CHROMEOS)
- dictionary->SetBoolean("showLauncher", true);
-#else
dictionary->SetBoolean(
"showLauncher",
- extensions_service_->default_apps()->GetDefaultAppsInstalled());
-#endif
+ extensions_service_->default_apps()->ShouldShowAppLauncher(
+ extensions_service_->GetAppIds()));
}
void AppLauncherHandler::HandleGetApps(const ListValue* args) {
@@ -217,7 +212,7 @@ void AppLauncherHandler::HandleGetApps(const ListValue* args) {
// b) Conceptually, it doesn't really make sense to count a
// prefchange-triggered refresh as a promo 'view'.
DefaultApps* default_apps = extensions_service_->default_apps();
- if (default_apps->CheckShouldShowPromo(extensions_service_->GetAppIds())) {
+ if (default_apps->ShouldShowPromo(extensions_service_->GetAppIds())) {
dictionary.SetBoolean("showPromo", true);
default_apps->DidShowPromo();
promo_active_ = true;
@@ -335,12 +330,11 @@ void AppLauncherHandler::HandleHideAppsPromo(const ListValue* args) {
UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppsPromoHistogram,
extension_misc::PROMO_CLOSE,
extension_misc::PROMO_BUCKET_BOUNDARY);
- DefaultApps* default_apps = extensions_service_->default_apps();
- const ExtensionIdSet* app_ids = default_apps->GetDefaultApps();
- DCHECK(*app_ids == extensions_service_->GetAppIds());
- for (ExtensionIdSet::const_iterator iter = app_ids->begin();
- iter != app_ids->end(); ++iter) {
+ DefaultApps* default_apps = extensions_service_->default_apps();
+ const ExtensionIdSet& app_ids = default_apps->default_apps();
+ for (ExtensionIdSet::const_iterator iter = app_ids.begin();
+ iter != app_ids.end(); ++iter) {
if (extensions_service_->GetExtensionById(*iter, true))
extensions_service_->UninstallExtension(*iter, false);
}
« no previous file with comments | « no previous file | chrome/browser/extensions/default_apps.h » ('j') | chrome/browser/extensions/default_apps_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698