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

Unified Diff: ui/app_list/views/apps_container_view.cc

Issue 163953008: Remove the animation delay for showing the top level apps when user opens app list launcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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
« no previous file with comments | « ui/app_list/views/apps_container_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/apps_container_view.cc
diff --git a/ui/app_list/views/apps_container_view.cc b/ui/app_list/views/apps_container_view.cc
index ff117a0d5011560f7949da9b6cb3a188de0b1e72..e2aa3e2b6f86bbe221b3148e635209993744e358 100644
--- a/ui/app_list/views/apps_container_view.cc
+++ b/ui/app_list/views/apps_container_view.cc
@@ -24,7 +24,8 @@ AppsContainerView::AppsContainerView(AppListMainView* app_list_main_view,
content::WebContents* start_page_contents)
: model_(model),
show_state_(SHOW_APPS),
- top_icon_animation_pending_count_(0) {
+ top_icon_animation_pending_count_(0),
+ show_apps_with_animation_(false) {
apps_grid_view_ = new AppsGridView(
app_list_main_view, pagination_model, start_page_contents);
apps_grid_view_->SetLayout(kPreferredIconDimension,
@@ -51,14 +52,14 @@ AppsContainerView::~AppsContainerView() {
void AppsContainerView::ShowActiveFolder(AppListFolderItem* folder_item) {
app_list_folder_view_->SetAppListFolderItem(folder_item);
- SetShowState(SHOW_ACTIVE_FOLDER);
+ SetShowState(SHOW_ACTIVE_FOLDER, false);
CreateViewsForFolderTopItemsAnimation(folder_item, true);
}
void AppsContainerView::ShowApps(AppListFolderItem* folder_item) {
PrepareToShowApps(folder_item);
- SetShowState(SHOW_APPS);
+ SetShowState(SHOW_APPS, true);
}
void AppsContainerView::SetDragAndDropHostOfCurrentAppList(
@@ -71,7 +72,7 @@ void AppsContainerView::SetDragAndDropHostOfCurrentAppList(
void AppsContainerView::ReparentFolderItemTransit(
AppListFolderItem* folder_item) {
PrepareToShowApps(folder_item);
- SetShowState(SHOW_ITEM_REPARENT);
+ SetShowState(SHOW_ITEM_REPARENT, false);
}
gfx::Size AppsContainerView::GetPreferredSize() {
@@ -91,9 +92,15 @@ void AppsContainerView::Layout() {
switch (show_state_) {
case SHOW_APPS:
folder_background_view_->SetVisible(false);
- app_list_folder_view_->ScheduleShowHideAnimation(false, false);
+ if (show_apps_with_animation_)
+ app_list_folder_view_->ScheduleShowHideAnimation(false, false);
+ else
+ app_list_folder_view_->HideViewImmediately();
apps_grid_view_->SetBoundsRect(rect);
- apps_grid_view_->ScheduleShowHideAnimation(true);
+ if (show_apps_with_animation_)
+ apps_grid_view_->ScheduleShowHideAnimation(true);
+ else
+ apps_grid_view_->SetVisible(true);
xiyuan 2014/02/13 22:53:42 Can we move the animation and show/hide code into
jennyz 2014/02/13 23:42:59 Done.
break;
case SHOW_ACTIVE_FOLDER:
folder_background_view_->SetBoundsRect(rect);
@@ -136,11 +143,13 @@ void AppsContainerView::OnTopIconAnimationsComplete() {
}
}
-void AppsContainerView::SetShowState(ShowState show_state) {
+void AppsContainerView::SetShowState(ShowState show_state,
+ bool show_apps_with_animation) {
if (show_state_ == show_state)
return;
show_state_ = show_state;
+ show_apps_with_animation_ = show_apps_with_animation;
Layout();
}
« no previous file with comments | « ui/app_list/views/apps_container_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698