1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_APP_LIST_VIEWS_APPS_GRID_VIEW_FOLDER_DELEGATE_H_
6 #define UI_APP_LIST_VIEWS_APPS_GRID_VIEW_FOLDER_DELEGATE_H_
8 #include "ui/app_list/app_list_export.h"
9 #include "ui/app_list/views/apps_grid_view.h"
21 class AppListItemView
;
23 // A delegate which allows an AppsGridView to communicate with its host folder.
24 class APP_LIST_EXPORT AppsGridViewFolderDelegate
{
26 // Updates the folder view background to show or hide folder container ink
28 virtual void UpdateFolderViewBackground(bool show_bubble
) = 0;
30 // Called when a folder item is dragged out of the folder to be re-parented.
31 // |original_drag_view| is the |drag_view_| inside the folder's grid view.
32 // |drag_point_in_folder_grid| is the last drag point in coordinate of the
33 // AppsGridView inside the folder.
34 virtual void ReparentItem(AppListItemView
* original_drag_view
,
35 const gfx::Point
& drag_point_in_folder_grid
) = 0;
37 // Dispatches drag event from the hidden grid view to the root level grid view
38 // for re-parenting a folder item.
39 virtual void DispatchDragEventForReparent(
40 AppsGridView::Pointer pointer
,
41 const gfx::Point
& drag_point_in_folder_grid
) = 0;
43 // Dispatches EndDrag event from the hidden grid view to the root level grid
44 // view for reparenting a folder item.
45 // |events_forwarded_to_drag_drop_host|: True if the dragged item is dropped
46 // to the drag_drop_host, eg. dropped on shelf.
47 // |cancel_drag|: True if the drag is ending because it has been canceled.
48 virtual void DispatchEndDragEventForReparent(
49 bool events_forwarded_to_drag_drop_host
,
50 bool cancel_drag
) = 0;
52 // Returns true if |point| falls outside of the folder container ink bubble.
53 virtual bool IsPointOutsideOfFolderBoundary(const gfx::Point
& point
) = 0;
55 // Returns true if the associated folder item is an OEM folder.
56 virtual bool IsOEMFolder() const = 0;
58 // Hides or show the root level's grid view. This is needed so that the
59 // synchronous drag has an icon for reparenting while it loads.
60 virtual void SetRootLevelDragViewVisible(bool visible
) = 0;
63 virtual ~AppsGridViewFolderDelegate() {}
66 } // namespace app_list
68 #endif // UI_APP_LIST_VIEWS_APPS_GRID_VIEW_FOLDER_DELEGATE_H_