Make castv2 performance test work.
[chromium-blink-merge.git] / ui / app_list / views / apps_grid_view_folder_delegate.h
blob30f58d8898bb2f4539f8aed82ce10b2a2f81f4b2
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"
11 namespace gfx {
12 class Point;
15 namespace ui {
16 class LocatedEvent;
19 namespace app_list {
21 class AppListItemView;
23 // A delegate which allows an AppsGridView to communicate with its host folder.
24 class APP_LIST_EXPORT AppsGridViewFolderDelegate {
25 public:
26 // Updates the folder view background to show or hide folder container ink
27 // bubble.
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,
36 bool has_native_drag) = 0;
38 // Dispatches drag event from the hidden grid view to the root level grid view
39 // for re-parenting a folder item.
40 virtual void DispatchDragEventForReparent(
41 AppsGridView::Pointer pointer,
42 const gfx::Point& drag_point_in_folder_grid) = 0;
44 // Dispatches EndDrag event from the hidden grid view to the root level grid
45 // view for reparenting a folder item.
46 // |events_forwarded_to_drag_drop_host|: True if the dragged item is dropped
47 // to the drag_drop_host, eg. dropped on shelf.
48 // |cancel_drag|: True if the drag is ending because it has been canceled.
49 virtual void DispatchEndDragEventForReparent(
50 bool events_forwarded_to_drag_drop_host,
51 bool cancel_drag) = 0;
53 // Returns true if |point| falls outside of the folder container ink bubble.
54 virtual bool IsPointOutsideOfFolderBoundary(const gfx::Point& point) = 0;
56 // Returns true if the associated folder item is an OEM folder.
57 virtual bool IsOEMFolder() const = 0;
59 // Hides or show the root level's grid view. This is needed so that the
60 // synchronous drag has an icon for reparenting while it loads.
61 virtual void SetRootLevelDragViewVisible(bool visible) = 0;
63 protected:
64 virtual ~AppsGridViewFolderDelegate() {}
67 } // namespace app_list
69 #endif // UI_APP_LIST_VIEWS_APPS_GRID_VIEW_FOLDER_DELEGATE_H_