Chromium Code Reviews| Index: ui/app_list/views/app_list_dnd_host.h |
| diff --git a/ui/app_list/views/app_list_dnd_host.h b/ui/app_list/views/app_list_dnd_host.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..90f4beb43039101ca34ca0675c93ffb5152b30a9 |
| --- /dev/null |
| +++ b/ui/app_list/views/app_list_dnd_host.h |
| @@ -0,0 +1,39 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
|
James Cook
2013/04/29 22:08:29
"Copyright 2013" without (c)
Mr4D (OOO till 08-26)
2013/04/30 16:59:01
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef UI_APP_LIST_VIEWS_APP_LIST_DND_HOST_H_ |
| +#define UI_APP_LIST_VIEWS_APP_LIST_DND_HOST_H_ |
| + |
| +#include <string> |
| + |
| +#include "ui/gfx/point.h" |
| + |
| +namespace app_list { |
| + |
| +// This class will get used by the AppListView to drag and drop Application |
| +// shortcuts onto another host (the launcher). |
| +class ApplicationDnDHost { |
|
James Cook
2013/04/29 22:08:29
DnD -> DragAndDrop, or just Drag, or just Drop. N
Mr4D (OOO till 08-26)
2013/04/30 16:59:01
Done.
|
| + public: |
| + // A drag operation could get started. The recipient has to return true if |
| + // he wants to take it - e.g. |location_in_screen_poordinates| is over a |
| + // target area. The passed |app_id| identifies the application which should |
| + // get dropped. |
| + virtual bool StartDrag(const std::string& app_id, |
| + const gfx::Point& location_in_screen_coordinates) = 0; |
| + |
| + // This gets only called when the |StartDrag| function returned true and it |
| + // dispatches the mouse coordinate change accordingly. When the function |
| + // returns false it requests that the operation gets aborted since the event |
|
James Cook
2013/04/29 22:08:29
nit: gets aborted -> be aborted
Mr4D (OOO till 08-26)
2013/04/30 16:59:01
Done.
|
| + // location is out of bounds. |
| + virtual bool Drag(const gfx::Point& location_in_screen_coordinates) = 0; |
| + |
| + // Once |StartDrag| returned true, this function is guaranteed to be called |
| + // when the mouse / touch events stop. If |cancel| is set, the drag operation |
| + // was aborted, otherwise the change should be kept. |
| + virtual void EndDrag(bool cancel) = 0; |
| +}; |
| + |
| +} // namespace app_list |
| + |
| +#endif // UI_APP_LIST_VIEWS_APP_LIST_DND_HOST_H_ |