Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1008)

Unified Diff: ash/launcher/launcher_view.h

Issue 14533006: Drag and drop between app list and launcher - First patch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/launcher/launcher_view.h
diff --git a/ash/launcher/launcher_view.h b/ash/launcher/launcher_view.h
index 3b1f0f36b1939f7709070069a4623321d03a528e..5be34eecb5bb1e73a5a86df45a0abc297d073a3d 100644
--- a/ash/launcher/launcher_view.h
+++ b/ash/launcher/launcher_view.h
@@ -12,6 +12,7 @@
#include "ash/launcher/launcher_model_observer.h"
#include "ash/wm/gestures/shelf_gesture_handler.h"
#include "base/observer_list.h"
+#include "ui/app_list/views/app_list_dnd_host.h"
#include "ui/views/animation/bounds_animator_observer.h"
#include "ui/views/context_menu_controller.h"
#include "ui/views/controls/button/button.h"
@@ -50,7 +51,8 @@ class ASH_EXPORT LauncherView : public views::View,
public LauncherButtonHost,
public views::ContextMenuController,
public views::FocusTraversable,
- public views::BoundsAnimatorObserver {
+ public views::BoundsAnimatorObserver,
+ public app_list::ApplicationDnDHost {
public:
LauncherView(LauncherModel* model,
LauncherDelegate* delegate,
@@ -97,6 +99,13 @@ class ASH_EXPORT LauncherView : public views::View,
virtual FocusTraversable* GetFocusTraversableParent() OVERRIDE;
virtual View* GetFocusTraversableParentView() OVERRIDE;
+ // Overridden from app_list::ApplicationDnDHost:
+ virtual bool StartDrag(
+ const std::string& app_id,
+ const gfx::Point& location_in_screen_coordinates) OVERRIDE;
+ virtual bool Drag(const gfx::Point& location_in_screen_coordinates) OVERRIDE;
+ virtual void EndDrag(bool cancel) OVERRIDE;
+
private:
friend class ash::test::LauncherViewTestAPI;
@@ -320,6 +329,17 @@ class ASH_EXPORT LauncherView : public views::View,
// element will be set to false.
bool* got_deleted_;
+ // True if a DND operation created the item in the launcher and it needs to
James Cook 2013/04/29 22:08:29 DND -> drag and drop or just drag
Mr4D (OOO till 08-26) 2013/04/30 16:59:01 Done.
+ // be deleted again if the operation gets cancelled.
+ bool dnd_item_created_;
+
+ // The launcher item which is currently used for a drag and a drop operation
+ // or 0 otherwise.
+ LauncherID dnd_launcher_id_;
+
+ // The application ID of the application which we drag and drop.
+ std::string dnd_app_id_;
+
DISALLOW_COPY_AND_ASSIGN(LauncherView);
};

Powered by Google App Engine
This is Rietveld 408576698