OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2013 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. | |
4 | |
5 #ifndef UI_APP_LIST_VIEWS_APP_LIST_DRAG_AND_DROP_HOST_H_ | |
6 #define UI_APP_LIST_VIEWS_APP_LIST_DRAG_AND_DROP_HOST_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "ui/gfx/point.h" | |
James Cook
2013/04/30 18:03:00
No need to fix for this CL, but you could have for
Mr4D (OOO till 08-26)
2013/04/30 18:22:48
Yes - right. Done.
| |
11 | |
12 namespace app_list { | |
13 | |
14 // This class will get used by the AppListView to drag and drop Application | |
15 // shortcuts onto another host (the launcher). | |
16 class ApplicationDragAndDropHost { | |
17 public: | |
18 // A drag operation could get started. The recipient has to return true if | |
19 // he wants to take it - e.g. |location_in_screen_poordinates| is over a | |
20 // target area. The passed |app_id| identifies the application which should | |
21 // get dropped. | |
22 virtual bool StartDrag(const std::string& app_id, | |
23 const gfx::Point& location_in_screen_coordinates) = 0; | |
24 | |
25 // This gets only called when the |StartDrag| function returned true and it | |
26 // dispatches the mouse coordinate change accordingly. When the function | |
27 // returns false it requests that the operation be aborted since the event | |
28 // location is out of bounds. | |
29 virtual bool Drag(const gfx::Point& location_in_screen_coordinates) = 0; | |
30 | |
31 // Once |StartDrag| returned true, this function is guaranteed to be called | |
32 // when the mouse / touch events stop. If |cancel| is set, the drag operation | |
33 // was aborted, otherwise the change should be kept. | |
34 virtual void EndDrag(bool cancel) = 0; | |
35 }; | |
36 | |
37 } // namespace app_list | |
38 | |
39 #endif // UI_APP_LIST_VIEWS_APP_LIST_DRAG_AND_DROP_HOST_H_ | |
OLD | NEW |