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

Side by Side Diff: ui/app_list/views/apps_container_view.cc

Issue 657793004: Moved FolderImageSource class to a separate file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/app-list-typedefs-iwyu
Patch Set: Fix GN. Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « ui/app_list/folder_image_source.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
14 #include "ui/app_list/views/app_list_folder_view.h" 15 #include "ui/app_list/views/app_list_folder_view.h"
15 #include "ui/app_list/views/app_list_item_view.h" 16 #include "ui/app_list/views/app_list_item_view.h"
16 #include "ui/app_list/views/app_list_main_view.h" 17 #include "ui/app_list/views/app_list_main_view.h"
17 #include "ui/app_list/views/apps_grid_view.h" 18 #include "ui/app_list/views/apps_grid_view.h"
18 #include "ui/app_list/views/folder_background_view.h" 19 #include "ui/app_list/views/folder_background_view.h"
19 #include "ui/events/event.h" 20 #include "ui/events/event.h"
20 21
21 namespace app_list { 22 namespace app_list {
22 23
23 AppsContainerView::AppsContainerView(AppListMainView* app_list_main_view, 24 AppsContainerView::AppsContainerView(AppListMainView* app_list_main_view,
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 } 196 }
196 197
197 std::vector<gfx::Rect> AppsContainerView::GetTopItemIconBoundsInActiveFolder() { 198 std::vector<gfx::Rect> AppsContainerView::GetTopItemIconBoundsInActiveFolder() {
198 // Get the active folder's icon bounds relative to AppsContainerView. 199 // Get the active folder's icon bounds relative to AppsContainerView.
199 AppListItemView* folder_item_view = 200 AppListItemView* folder_item_view =
200 apps_grid_view_->activated_folder_item_view(); 201 apps_grid_view_->activated_folder_item_view();
201 gfx::Rect to_grid_view = folder_item_view->ConvertRectToParent( 202 gfx::Rect to_grid_view = folder_item_view->ConvertRectToParent(
202 folder_item_view->GetIconBounds()); 203 folder_item_view->GetIconBounds());
203 gfx::Rect to_container = apps_grid_view_->ConvertRectToParent(to_grid_view); 204 gfx::Rect to_container = apps_grid_view_->ConvertRectToParent(to_grid_view);
204 205
205 return AppListFolderItem::GetTopIconsBounds(to_container); 206 return FolderImageSource::GetTopIconsBounds(to_container);
206 } 207 }
207 208
208 void AppsContainerView::CreateViewsForFolderTopItemsAnimation( 209 void AppsContainerView::CreateViewsForFolderTopItemsAnimation(
209 AppListFolderItem* active_folder, 210 AppListFolderItem* active_folder,
210 bool open_folder) { 211 bool open_folder) {
211 top_icon_views_.clear(); 212 top_icon_views_.clear();
212 std::vector<gfx::Rect> top_items_bounds = 213 std::vector<gfx::Rect> top_items_bounds =
213 GetTopItemIconBoundsInActiveFolder(); 214 GetTopItemIconBoundsInActiveFolder();
214 top_icon_animation_pending_count_ = 215 top_icon_animation_pending_count_ =
215 std::min(kNumFolderTopItems, active_folder->item_list()->item_count()); 216 std::min(kNumFolderTopItems, active_folder->item_list()->item_count());
(...skipping 19 matching lines...) Expand all
235 void AppsContainerView::PrepareToShowApps(AppListFolderItem* folder_item) { 236 void AppsContainerView::PrepareToShowApps(AppListFolderItem* folder_item) {
236 if (folder_item) 237 if (folder_item)
237 CreateViewsForFolderTopItemsAnimation(folder_item, false); 238 CreateViewsForFolderTopItemsAnimation(folder_item, false);
238 239
239 // Hide the active folder item until the animation completes. 240 // Hide the active folder item until the animation completes.
240 if (apps_grid_view_->activated_folder_item_view()) 241 if (apps_grid_view_->activated_folder_item_view())
241 apps_grid_view_->activated_folder_item_view()->SetVisible(false); 242 apps_grid_view_->activated_folder_item_view()->SetVisible(false);
242 } 243 }
243 244
244 } // namespace app_list 245 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/folder_image_source.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698