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

Unified Diff: ui/views/widget/desktop_aura/desktop_drop_target_win.h

Issue 11444013: Get drag and drop working for win aura. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 8 years 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: ui/views/widget/desktop_aura/desktop_drop_target_win.h
===================================================================
--- ui/views/widget/desktop_aura/desktop_drop_target_win.h (revision 0)
+++ ui/views/widget/desktop_aura/desktop_drop_target_win.h (revision 0)
@@ -0,0 +1,81 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTIOP_DROP_TARGET_WIN_H_
+#define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTIOP_DROP_TARGET_WIN_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "ui/base/dragdrop/drop_target.h"
+#include "ui/aura/window_observer.h"
+
+namespace aura {
+class RootWindow;
+namespace client {
+class DragDropDelegate;
+}
+}
+
+namespace ui {
+class DropTargetEvent;
+class OSExchangeData;
+}
+
+namespace views {
+
+// DesktopDropTargetWin takes care of managing drag and drop for
+// DesktopRootWindowHostWin. It converts Windows OLE drop messages into
+// aura::client::DragDropDelegate calls.
+class DesktopDropTargetWin : public ui::DropTarget,
+ public aura::WindowObserver {
+ public:
+ DesktopDropTargetWin(aura::RootWindow* root_window, HWND window);
+ virtual ~DesktopDropTargetWin();
+
+ private:
+ // ui::DropTarget implementation:
+ virtual DWORD OnDragEnter(IDataObject* data_object,
+ DWORD key_state,
+ POINT position,
+ DWORD effect) OVERRIDE;
+ virtual DWORD OnDragOver(IDataObject* data_object,
+ DWORD key_state,
+ POINT position,
+ DWORD effect) OVERRIDE;
+ virtual void OnDragLeave(IDataObject* data_object) OVERRIDE;
+ virtual DWORD OnDrop(IDataObject* data_object,
+ DWORD key_state,
+ POINT position,
+ DWORD effect) OVERRIDE;
+
+ // aura::WindowObserver implementation:
+ virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE;
+
+ // Common functionality for the ui::DropTarget methods to translate from COM
+ // data types to Aura ones.
+ void Translate(IDataObject* data_object,
+ DWORD key_state,
+ POINT cursor_position,
+ DWORD effect,
+ scoped_ptr<ui::OSExchangeData>* data,
+ scoped_ptr<ui::DropTargetEvent>* event,
+ aura::client::DragDropDelegate** delegate);
+
+ void NotifyDragLeave();
+
+ // The root window associated with this drop target.
+ aura::RootWindow* root_window_;
+
+ // The Aura window that is currently under the cursor. We need to manually
+ // keep track of this because Windows will only call our drag enter method
+ // once when the user enters the associated HWND. But inside that HWND there
+ // could be multiple aura windows, so we need to generate drag enter events
+ // for them.
+ aura::Window* target_window_;
+
+ DISALLOW_COPY_AND_ASSIGN(DesktopDropTargetWin);
+};
+
+} // namespace views
+
+#endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTIOP_DROP_TARGET_WIN_H_
Property changes on: ui\views\widget\desktop_aura\desktop_drop_target_win.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc ('k') | ui/views/widget/desktop_aura/desktop_drop_target_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698