Chromium Code Reviews| 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..bf5a7658837c3162864314bdd631dca82eb28d0f 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(); |
|
jennyz
2014/03/27 18:35:54
We don't need to ResetForShow in the constructor.
calamity
2014/03/28 03:43:27
Done. Note that this removes the SetState() call t
|
| } |
| 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,12 @@ void AppsContainerView::ShowApps(AppListFolderItem* folder_item) { |
| true); /* show apps with animation */ |
| } |
| +void AppsContainerView::ResetForShow() { |
| + SetShowState(SHOW_APPS, false /* show apps without animation */); |
| + folder_background_view_->UpdateFolderContainerBubble( |
| + FolderBackgroundView::NO_BUBBLE); |
| +} |
| + |
| void AppsContainerView::SetDragAndDropHostOfCurrentAppList( |
| ApplicationDragAndDropHost* drag_and_drop_host) { |
| apps_grid_view()->SetDragAndDropHostOfCurrentAppList(drag_and_drop_host); |
| @@ -130,8 +139,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 +160,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 +227,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(); |
|
jennyz
2014/03/27 18:35:54
Cache activated_folder_view_ seems dangerous,the i
calamity
2014/03/28 03:43:27
This does happen on ChromeOS (checked on latest ca
|
| + activated_folder_view_->SetVisible(false); |
| + } |
| } |
| } // namespace app_list |