| 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" |
| 11 #include "ui/app_list/app_list_constants.h" | 11 #include "ui/app_list/app_list_constants.h" |
| 12 #include "ui/app_list/app_list_folder_item.h" | 12 #include "ui/app_list/app_list_folder_item.h" |
| 13 #include "ui/app_list/app_list_switches.h" | 13 #include "ui/app_list/app_list_switches.h" |
| 14 #include "ui/app_list/folder_image_source.h" | |
| 15 #include "ui/app_list/views/app_list_folder_view.h" | 14 #include "ui/app_list/views/app_list_folder_view.h" |
| 16 #include "ui/app_list/views/app_list_item_view.h" | 15 #include "ui/app_list/views/app_list_item_view.h" |
| 17 #include "ui/app_list/views/app_list_main_view.h" | 16 #include "ui/app_list/views/app_list_main_view.h" |
| 18 #include "ui/app_list/views/apps_grid_view.h" | 17 #include "ui/app_list/views/apps_grid_view.h" |
| 19 #include "ui/app_list/views/folder_background_view.h" | 18 #include "ui/app_list/views/folder_background_view.h" |
| 20 #include "ui/events/event.h" | 19 #include "ui/events/event.h" |
| 21 | 20 |
| 22 namespace app_list { | 21 namespace app_list { |
| 23 | 22 |
| 24 AppsContainerView::AppsContainerView(AppListMainView* app_list_main_view, | 23 AppsContainerView::AppsContainerView(AppListMainView* app_list_main_view, |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 } | 195 } |
| 197 | 196 |
| 198 std::vector<gfx::Rect> AppsContainerView::GetTopItemIconBoundsInActiveFolder() { | 197 std::vector<gfx::Rect> AppsContainerView::GetTopItemIconBoundsInActiveFolder() { |
| 199 // Get the active folder's icon bounds relative to AppsContainerView. | 198 // Get the active folder's icon bounds relative to AppsContainerView. |
| 200 AppListItemView* folder_item_view = | 199 AppListItemView* folder_item_view = |
| 201 apps_grid_view_->activated_folder_item_view(); | 200 apps_grid_view_->activated_folder_item_view(); |
| 202 gfx::Rect to_grid_view = folder_item_view->ConvertRectToParent( | 201 gfx::Rect to_grid_view = folder_item_view->ConvertRectToParent( |
| 203 folder_item_view->GetIconBounds()); | 202 folder_item_view->GetIconBounds()); |
| 204 gfx::Rect to_container = apps_grid_view_->ConvertRectToParent(to_grid_view); | 203 gfx::Rect to_container = apps_grid_view_->ConvertRectToParent(to_grid_view); |
| 205 | 204 |
| 206 return FolderImageSource::GetTopIconsBounds(to_container); | 205 return FolderImage::GetTopIconsBounds(to_container); |
| 207 } | 206 } |
| 208 | 207 |
| 209 void AppsContainerView::CreateViewsForFolderTopItemsAnimation( | 208 void AppsContainerView::CreateViewsForFolderTopItemsAnimation( |
| 210 AppListFolderItem* active_folder, | 209 AppListFolderItem* active_folder, |
| 211 bool open_folder) { | 210 bool open_folder) { |
| 212 top_icon_views_.clear(); | 211 top_icon_views_.clear(); |
| 213 std::vector<gfx::Rect> top_items_bounds = | 212 std::vector<gfx::Rect> top_items_bounds = |
| 214 GetTopItemIconBoundsInActiveFolder(); | 213 GetTopItemIconBoundsInActiveFolder(); |
| 215 top_icon_animation_pending_count_ = | 214 top_icon_animation_pending_count_ = |
| 216 std::min(kNumFolderTopItems, active_folder->item_list()->item_count()); | 215 std::min(kNumFolderTopItems, active_folder->item_list()->item_count()); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 236 void AppsContainerView::PrepareToShowApps(AppListFolderItem* folder_item) { | 235 void AppsContainerView::PrepareToShowApps(AppListFolderItem* folder_item) { |
| 237 if (folder_item) | 236 if (folder_item) |
| 238 CreateViewsForFolderTopItemsAnimation(folder_item, false); | 237 CreateViewsForFolderTopItemsAnimation(folder_item, false); |
| 239 | 238 |
| 240 // Hide the active folder item until the animation completes. | 239 // Hide the active folder item until the animation completes. |
| 241 if (apps_grid_view_->activated_folder_item_view()) | 240 if (apps_grid_view_->activated_folder_item_view()) |
| 242 apps_grid_view_->activated_folder_item_view()->SetVisible(false); | 241 apps_grid_view_->activated_folder_item_view()->SetVisible(false); |
| 243 } | 242 } |
| 244 | 243 |
| 245 } // namespace app_list | 244 } // namespace app_list |
| OLD | NEW |