| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/app_list/views/apps_container_view.h" | 5 #include "ui/app_list/views/apps_container_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 CreateViewsForFolderTopItemsAnimation(folder_item, true); | 60 CreateViewsForFolderTopItemsAnimation(folder_item, true); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void AppsContainerView::ShowApps(AppListFolderItem* folder_item) { | 63 void AppsContainerView::ShowApps(AppListFolderItem* folder_item) { |
| 64 PrepareToShowApps(folder_item); | 64 PrepareToShowApps(folder_item); |
| 65 SetShowState(SHOW_APPS, | 65 SetShowState(SHOW_APPS, |
| 66 true); /* show apps with animation */ | 66 true); /* show apps with animation */ |
| 67 } | 67 } |
| 68 | 68 |
| 69 void AppsContainerView::ResetForShowApps() { |
| 70 SetShowState(SHOW_APPS, false /* show apps without animation */); |
| 71 folder_background_view_->UpdateFolderContainerBubble( |
| 72 FolderBackgroundView::NO_BUBBLE); |
| 73 } |
| 74 |
| 69 void AppsContainerView::SetDragAndDropHostOfCurrentAppList( | 75 void AppsContainerView::SetDragAndDropHostOfCurrentAppList( |
| 70 ApplicationDragAndDropHost* drag_and_drop_host) { | 76 ApplicationDragAndDropHost* drag_and_drop_host) { |
| 71 apps_grid_view()->SetDragAndDropHostOfCurrentAppList(drag_and_drop_host); | 77 apps_grid_view()->SetDragAndDropHostOfCurrentAppList(drag_and_drop_host); |
| 72 app_list_folder_view()->items_grid_view()-> | 78 app_list_folder_view()->items_grid_view()-> |
| 73 SetDragAndDropHostOfCurrentAppList(drag_and_drop_host); | 79 SetDragAndDropHostOfCurrentAppList(drag_and_drop_host); |
| 74 } | 80 } |
| 75 | 81 |
| 76 void AppsContainerView::ReparentFolderItemTransit( | 82 void AppsContainerView::ReparentFolderItemTransit( |
| 77 AppListFolderItem* folder_item) { | 83 AppListFolderItem* folder_item) { |
| 78 PrepareToShowApps(folder_item); | 84 PrepareToShowApps(folder_item); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 show_state_ = show_state; | 144 show_state_ = show_state; |
| 139 | 145 |
| 140 switch (show_state_) { | 146 switch (show_state_) { |
| 141 case SHOW_APPS: | 147 case SHOW_APPS: |
| 142 folder_background_view_->SetVisible(false); | 148 folder_background_view_->SetVisible(false); |
| 143 if (show_apps_with_animation) { | 149 if (show_apps_with_animation) { |
| 144 app_list_folder_view_->ScheduleShowHideAnimation(false, false); | 150 app_list_folder_view_->ScheduleShowHideAnimation(false, false); |
| 145 apps_grid_view_->ScheduleShowHideAnimation(true); | 151 apps_grid_view_->ScheduleShowHideAnimation(true); |
| 146 } else { | 152 } else { |
| 147 app_list_folder_view_->HideViewImmediately(); | 153 app_list_folder_view_->HideViewImmediately(); |
| 148 apps_grid_view_->SetVisible(true); | 154 apps_grid_view_->ResetForShowApps(); |
| 149 } | 155 } |
| 150 break; | 156 break; |
| 151 case SHOW_ACTIVE_FOLDER: | 157 case SHOW_ACTIVE_FOLDER: |
| 152 folder_background_view_->SetVisible(true); | 158 folder_background_view_->SetVisible(true); |
| 153 apps_grid_view_->ScheduleShowHideAnimation(false); | 159 apps_grid_view_->ScheduleShowHideAnimation(false); |
| 154 app_list_folder_view_->ScheduleShowHideAnimation(true, false); | 160 app_list_folder_view_->ScheduleShowHideAnimation(true, false); |
| 155 break; | 161 break; |
| 156 case SHOW_ITEM_REPARENT: | 162 case SHOW_ITEM_REPARENT: |
| 157 folder_background_view_->SetVisible(false); | 163 folder_background_view_->SetVisible(false); |
| 158 folder_background_view_->UpdateFolderContainerBubble( | 164 folder_background_view_->UpdateFolderContainerBubble( |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 void AppsContainerView::PrepareToShowApps(AppListFolderItem* folder_item) { | 210 void AppsContainerView::PrepareToShowApps(AppListFolderItem* folder_item) { |
| 205 if (folder_item) | 211 if (folder_item) |
| 206 CreateViewsForFolderTopItemsAnimation(folder_item, false); | 212 CreateViewsForFolderTopItemsAnimation(folder_item, false); |
| 207 | 213 |
| 208 // Hide the active folder item until the animation completes. | 214 // Hide the active folder item until the animation completes. |
| 209 if (apps_grid_view_->activated_item_view()) | 215 if (apps_grid_view_->activated_item_view()) |
| 210 apps_grid_view_->activated_item_view()->SetVisible(false); | 216 apps_grid_view_->activated_item_view()->SetVisible(false); |
| 211 } | 217 } |
| 212 | 218 |
| 213 } // namespace app_list | 219 } // namespace app_list |
| OLD | NEW |