Chromium Code Reviews| 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..92f2e90d25389111e06e2c53531ff3fa1e7a14bb 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" |
|
xiyuan
2014/02/06 22:45:12
nit: This can go in cc file.
jennyz
2014/02/07 00:03:10
Since AppsGridView::Pointer is used in DispatchDra
xiyuan
2014/02/07 00:32:19
I see. Yep, enum could not be forward declared.
|
| #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,43 @@ 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); |
|
xiyuan
2014/02/06 22:45:12
nit: 4-space indent
jennyz
2014/02/07 00:03:10
Done.
|
| + |
| + // 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); |
| + |
| + bool hide_for_reparent() const { return hide_for_reparent_; } |
|
xiyuan
2014/02/06 22:45:12
nit: accessor at the last section of methods
jennyz
2014/02/07 00:03:10
Done.
|
| + |
| // views::View overrides: |
| virtual gfx::Size GetPreferredSize() OVERRIDE; |
| virtual void Layout() OVERRIDE; |
| @@ -61,9 +94,18 @@ class AppListFolderView : public views::View, |
| // ui::ImplicitAnimationObserver overrides: |
| virtual void OnImplicitAnimationsCompleted() OVERRIDE; |
| + AppsGridView* items_grid_view() { return items_grid_view_; } |
| + |
| 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 +121,8 @@ class AppListFolderView : public views::View, |
| scoped_ptr<PaginationModel> pagination_model_; |
| + bool hide_for_reparent_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(AppListFolderView); |
| }; |