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 95ec3b74bc04496173480e22ba39820bad770fe9..736aaf2467cd90eb35de1cf0c2f5150a046c329f 100644 |
--- a/ui/app_list/views/apps_container_view.cc |
+++ b/ui/app_list/views/apps_container_view.cc |
@@ -27,6 +27,7 @@ AppsContainerView::AppsContainerView(AppListMainView* app_list_main_view, |
content::WebContents* start_page_contents) |
: model_(model), |
show_state_(SHOW_APPS), |
+ activated_folder_view_(NULL), |
top_icon_animation_pending_count_(0) { |
apps_grid_view_ = new AppsGridView( |
app_list_main_view, pagination_model, start_page_contents); |
@@ -52,14 +53,16 @@ AppsContainerView::AppsContainerView(AppListMainView* app_list_main_view, |
apps_grid_view_->SetModel(model_); |
apps_grid_view_->SetItemList(model_->item_list()); |
- SetShowState(SHOW_APPS, |
- false); /* show apps without animation */ |
+ ResetForShow(); |
} |
AppsContainerView::~AppsContainerView() { |
} |
void AppsContainerView::ShowActiveFolder(AppListFolderItem* folder_item) { |
+ if (activated_folder_view_) |
+ return; |
+ |
app_list_folder_view_->SetAppListFolderItem(folder_item); |
SetShowState(SHOW_ACTIVE_FOLDER, false); |
@@ -72,6 +75,10 @@ void AppsContainerView::ShowApps(AppListFolderItem* folder_item) { |
true); /* show apps with animation */ |
} |
+void AppsContainerView::ResetForShow() { |
+ SetShowState(SHOW_APPS, false /* show apps without animation */); |
+} |
+ |
void AppsContainerView::SetDragAndDropHostOfCurrentAppList( |
ApplicationDragAndDropHost* drag_and_drop_host) { |
apps_grid_view()->SetDragAndDropHostOfCurrentAppList(drag_and_drop_host); |
@@ -130,8 +137,9 @@ void AppsContainerView::OnTopIconAnimationsComplete() { |
// Show the folder icon when closing the folder. |
if ((show_state_ == SHOW_APPS || show_state_ == SHOW_ITEM_REPARENT) && |
- apps_grid_view_->activated_item_view()) { |
- apps_grid_view_->activated_item_view()->SetVisible(true); |
+ activated_folder_view_) { |
+ activated_folder_view_->SetVisible(true); |
+ activated_folder_view_ = NULL; |
} |
} |
} |
@@ -150,7 +158,12 @@ void AppsContainerView::SetShowState(ShowState show_state, |
app_list_folder_view_->ScheduleShowHideAnimation(false, false); |
apps_grid_view_->ScheduleShowHideAnimation(true); |
} else { |
+ if (activated_folder_view_) { |
+ activated_folder_view_->SetVisible(true); |
+ activated_folder_view_ = NULL; |
+ } |
app_list_folder_view_->HideViewImmediately(); |
+ apps_grid_view_->layer()->SetOpacity(1.0f); |
apps_grid_view_->SetVisible(true); |
} |
break; |
@@ -212,8 +225,10 @@ void AppsContainerView::PrepareToShowApps(AppListFolderItem* folder_item) { |
CreateViewsForFolderTopItemsAnimation(folder_item, false); |
// Hide the active folder item until the animation completes. |
- if (apps_grid_view_->activated_item_view()) |
- apps_grid_view_->activated_item_view()->SetVisible(false); |
+ if (apps_grid_view_->activated_item_view()) { |
+ activated_folder_view_ = apps_grid_view_->activated_item_view(); |
+ activated_folder_view_->SetVisible(false); |
+ } |
} |
} // namespace app_list |