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

Unified Diff: ui/app_list/views/app_list_folder_view.h

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.cc ('k') | ui/app_list/views/app_list_folder_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/app_list_folder_view.h
diff --git a/ui/app_list/views/app_list_folder_view.h b/ui/app_list/views/app_list_folder_view.h
index 7052588179b10b2b6fbcf9aef86f4eb07e8a3eed..72b8fc5bd3e87d27d723fd39d6986d5319771062 100644
--- a/ui/app_list/views/app_list_folder_view.h
+++ b/ui/app_list/views/app_list_folder_view.h
@@ -6,6 +6,7 @@
#define UI_APP_LIST_VIEWS_APP_LIST_FOLDER_VIEW_H_
#include "ui/app_list/app_list_item_list_observer.h"
+#include "ui/app_list/views/apps_grid_view.h"
#include "ui/app_list/views/folder_header_view.h"
#include "ui/app_list/views/folder_header_view_delegate.h"
#include "ui/compositor/layer_animation_observer.h"
@@ -25,6 +26,7 @@ namespace app_list {
class AppsContainerView;
class AppsGridView;
class AppListFolderItem;
+class AppListItemView;
class AppListMainView;
class AppListModel;
class FolderHeaderView;
@@ -44,12 +46,41 @@ class AppListFolderView : public views::View,
void SetAppListFolderItem(AppListFolderItem* folder);
// Schedules an animation to show or hide the view.
- void ScheduleShowHideAnimation(bool show);
+ // If |show| is false, the view should be set to invisible after the
+ // animation is done unless |hide_for_reparent| is true.
+ void ScheduleShowHideAnimation(bool show, bool hide_for_reparent);
// Gets icon image bounds of the item at |index|, relative to
// AppListFolderView.
gfx::Rect GetItemIconBoundsAt(int index);
+ // Updates the folder view background to show or hide folder container ink
+ // bubble.
+ void UpdateFolderViewBackground(bool show_bubble);
+
+ void UpdateFolderNameVisibility(bool visible);
+
+ // Returns true if |point| falls outside of the folder container ink bubble.
+ bool IsPointOutsideOfFolderBoundray(const gfx::Point& point);
+
+ // Called when a folder item is dragged out of the folder to be re-parented.
+ // |original_drag_view| is the |drag_view_| inside the folder's grid view.
+ // |drag_point_in_folder_grid| is the last drag point in coordinate of the
+ // AppsGridView inside the folder.
+ void ReparentItem(AppListItemView* original_drag_view,
+ const gfx::Point& drag_point_in_folder_grid);
+
+ // Dispatches drag event from the hidden grid view to the root level grid view
+ // for re-parenting a folder item.
+ void DispatchDragEventForReparent(AppsGridView::Pointer pointer,
+ const ui::LocatedEvent& event);
+
+ // Dispatches EndDrag event from the hidden grid view to the root level grid
+ // view for reparenting a folder item.
+ // |events_forwarded_to_drag_drop_host|: True if the dragged item is dropped
+ // to the drag_drop_host, eg. dropped on shelf.
+ void DispatchEndDragEventForReparent(bool events_forwarded_to_drag_drop_host);
+
// views::View overrides:
virtual gfx::Size GetPreferredSize() OVERRIDE;
virtual void Layout() OVERRIDE;
@@ -61,9 +92,19 @@ class AppListFolderView : public views::View,
// ui::ImplicitAnimationObserver overrides:
virtual void OnImplicitAnimationsCompleted() OVERRIDE;
+ AppsGridView* items_grid_view() { return items_grid_view_; }
+ bool hide_for_reparent() const { return hide_for_reparent_; }
+
private:
void CalculateIdealBounds();
+ // Starts setting up drag in root level apps grid view for re-parenting a
+ // folder item.
+ // |drag_point_in_root_grid| is in the cooridnates of root level AppsGridView.
+ void StartSetupDragInRootLevelAppsGridView(
+ AppListItemView* original_drag_view,
+ const gfx::Point& drag_point_in_root_grid);
+
// Overridden from FolderHeaderViewDelegate:
virtual void NavigateBack(AppListFolderItem* item,
const ui::Event& event_flags) OVERRIDE;
@@ -79,6 +120,8 @@ class AppListFolderView : public views::View,
scoped_ptr<PaginationModel> pagination_model_;
+ bool hide_for_reparent_;
+
DISALLOW_COPY_AND_ASSIGN(AppListFolderView);
};
« no previous file with comments | « ui/app_list/app_list_folder_item.cc ('k') | ui/app_list/views/app_list_folder_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698