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

Unified Diff: ui/app_list/app_list_folder_item.cc

Issue 136303008: Implement ui for re-parenting an item from an app list folder to another position or folder in the … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 6 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/app_list/app_list_folder_item.h ('k') | ui/app_list/views/app_list_folder_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/app_list_folder_item.cc
diff --git a/ui/app_list/app_list_folder_item.cc b/ui/app_list/app_list_folder_item.cc
index 355ffd4e7c4ba354f165b8db8141810cc33d2ab1..abc996f0421195a66f36764c85eff584a294736c 100644
--- a/ui/app_list/app_list_folder_item.cc
+++ b/ui/app_list/app_list_folder_item.cc
@@ -106,6 +106,22 @@ const gfx::ImageSkia& AppListFolderItem::GetTopIcon(size_t item_index) {
return top_items_[item_index]->icon();
}
+gfx::Rect AppListFolderItem::GetTargetIconRectInFolderForItem(
+ AppListItem* item,
+ const gfx::Rect& folder_icon_bounds) {
+ for (size_t i = 0; i < top_items_.size(); ++i) {
+ if (item->id() == top_items_[i]->id()) {
+ Rects rects = AppListFolderItem::GetTopIconsBounds(folder_icon_bounds);
+ return rects[i];
+ }
+ }
+
+ gfx::Rect target_rect(folder_icon_bounds);
+ target_rect.ClampToCenteredSize(
+ gfx::Size(kItemIconDimension, kItemIconDimension));
+ return target_rect;
+}
+
void AppListFolderItem::Activate(int event_flags) {
// Folder handling is implemented by the View, so do nothing.
}
« no previous file with comments | « ui/app_list/app_list_folder_item.h ('k') | ui/app_list/views/app_list_folder_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698