Chromium Code Reviews| Index: ui/app_list/views/apps_grid_view.h |
| diff --git a/ui/app_list/views/apps_grid_view.h b/ui/app_list/views/apps_grid_view.h |
| index 483f737890686822a6790fda7faaaca036e5197e..27bd7f3d799a991a2aa42d7e55a258b2ae810546 100644 |
| --- a/ui/app_list/views/apps_grid_view.h |
| +++ b/ui/app_list/views/apps_grid_view.h |
| @@ -12,6 +12,7 @@ |
| #include "ui/app_list/app_list_model.h" |
| #include "ui/app_list/app_list_model_observer.h" |
| #include "ui/app_list/pagination_model_observer.h" |
| +#include "ui/base/dragdrop/drag_source_win.h" |
|
xiyuan
2013/06/19 05:41:38
Shouldn't this be wrapped in a #if defined(OS_WIN)
koz (OOO until 15th September)
2013/06/19 07:55:08
Done.
|
| #include "ui/base/models/list_model_observer.h" |
| #include "ui/views/animation/bounds_animator.h" |
| #include "ui/views/controls/button/button.h" |
| @@ -25,6 +26,10 @@ class DragImageView; |
| namespace app_list { |
| +#if defined(OS_WIN) |
| +class SynchronousDrag; |
| +#endif |
| + |
| namespace test { |
| class AppsGridViewTestApi; |
| } |
| @@ -70,12 +75,22 @@ class APP_LIST_EXPORT AppsGridView : public views::View, |
| void InitiateDrag(AppListItemView* view, |
| Pointer pointer, |
| const ui::LocatedEvent& event); |
| - void UpdateDrag(AppListItemView* view, |
| - Pointer pointer, |
| - const ui::LocatedEvent& event); |
| + |
| + // Called from AppListItemView when it receives a drag event. |
| + void UpdateDragFromItem(Pointer pointer, |
| + const ui::LocatedEvent& event); |
| + |
| + // Called when the user is dragging an app. |point| is in grid view |
| + // coordinates. |
| + void UpdateDrag(Pointer pointer, const gfx::Point& point); |
| void EndDrag(bool cancel); |
| bool IsDraggedView(const views::View* view) const; |
| + void StartSettingUpSynchronousDrag(); |
| + bool RunSynchronousDrag(); |
| + void CleanUpSynchronousDrag(); |
| + void OnGotShortcutPath(const base::FilePath& path); |
| + |
| // Set the drag and drop host for application links. |
| void SetDragAndDropHostOfCurrentAppList( |
| ApplicationDragAndDropHost* drag_and_drop_host); |
| @@ -93,6 +108,14 @@ class APP_LIST_EXPORT AppsGridView : public views::View, |
| virtual bool OnKeyReleased(const ui::KeyEvent& event) OVERRIDE; |
| virtual void ViewHierarchyChanged( |
| const ViewHierarchyChangedDetails& details) OVERRIDE; |
| + virtual bool GetDropFormats( |
| + int* formats, |
| + std::set<OSExchangeData::CustomFormat>* custom_formats) OVERRIDE; |
| + virtual bool CanDrop(const OSExchangeData& data) OVERRIDE; |
| + virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; |
| + |
| + // Stops the timer that triggers a page flip during a drag. |
| + void StopPageFlipTimer(); |
| // Get the last grid view which was created. |
| static AppsGridView* GetLastGridViewForTest(); |
| @@ -177,7 +200,7 @@ class APP_LIST_EXPORT AppsGridView : public views::View, |
| bool use_page_button_hovering); |
| // Dispatch the drag and drop update event to the dnd host (if needed). |
| - void DispatchDragEventToDragAndDropHost(const ui::LocatedEvent& event); |
| + void DispatchDragEventToDragAndDropHost(const gfx::Point& point); |
| // Starts the page flip timer if |drag_point| is in left/right side page flip |
| // zone or is over page switcher. |
| @@ -229,7 +252,22 @@ class APP_LIST_EXPORT AppsGridView : public views::View, |
| views::View* selected_view_; |
| AppListItemView* drag_view_; |
| - gfx::Point drag_start_; |
| + |
| + // The point where the drag started in AppListItemView coordinates. |
| + gfx::Point drag_view_offset_; |
| + |
| + // The point where the drag started in GridView coordinates. |
| + gfx::Point drag_start_grid_view_; |
| + |
| + // The location of |drag_view_| when the drag started. |
| + gfx::Point drag_view_start_; |
| + |
| +#if defined(OS_WIN) |
| + // Created when a drag is started (ie: drag exceeds the drag threshold), but |
| + // not Run() until supplied with a shortcut path. |
| + scoped_refptr<SynchronousDrag> synchronous_drag_; |
| +#endif |
| + |
| Pointer drag_pointer_; |
| Index drop_target_; |