diff options
Diffstat (limited to 'chrome/browser/dom_ui/app_launcher_handler.cc')
-rw-r--r-- | chrome/browser/dom_ui/app_launcher_handler.cc | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/chrome/browser/dom_ui/app_launcher_handler.cc b/chrome/browser/dom_ui/app_launcher_handler.cc index 64d128a..aba23f1 100644 --- a/chrome/browser/dom_ui/app_launcher_handler.cc +++ b/chrome/browser/dom_ui/app_launcher_handler.cc @@ -4,7 +4,6 @@ #include "chrome/browser/dom_ui/app_launcher_handler.h" -#include "app/animation.h" #include "base/metrics/histogram.h" #include "base/string_number_conversions.h" #include "base/string_split.h" @@ -32,6 +31,7 @@ #include "gfx/rect.h" #include "grit/browser_resources.h" #include "grit/generated_resources.h" +#include "ui/base/animation/animation.h" namespace { @@ -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); } @@ -416,7 +410,7 @@ void AppLauncherHandler::AnimateAppIcon(const Extension* extension, const gfx::Rect& rect) { // We make this check for the case of minimized windows, unit tests, etc. if (platform_util::IsVisible(dom_ui_->tab_contents()->GetNativeView()) && - Animation::ShouldRenderRichAnimation()) { + ui::Animation::ShouldRenderRichAnimation()) { #if defined(OS_WIN) AppLaunchedAnimation::Show(extension, rect); #else |