1 // Copyright (c) 2011 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.
5 #ifndef UI_VIEWS_WIDGET_DROP_TARGET_WIN_H_
6 #define UI_VIEWS_WIDGET_DROP_TARGET_WIN_H_
8 #include "ui/base/dragdrop/drop_target_win.h"
9 #include "ui/views/widget/drop_helper.h"
18 // DropTargetWin takes care of managing drag and drop for NativeWidgetWin. It
19 // converts Windows OLE drop messages into Views drop messages.
21 // DropTargetWin uses DropHelper to manage the appropriate view to target
23 class DropTargetWin
: public ui::DropTargetWin
{
25 explicit DropTargetWin(internal::RootView
* root_view
);
26 virtual ~DropTargetWin();
28 // If a drag and drop is underway and view is the current drop target, the
29 // drop target is set to null.
30 // This is invoked when a View is removed from the RootView to make sure
31 // we don't target a view that was removed during dnd.
32 void ResetTargetViewIfEquals(View
* view
);
35 virtual DWORD
OnDragOver(IDataObject
* data_object
,
37 POINT cursor_position
,
40 virtual void OnDragLeave(IDataObject
* data_object
);
42 virtual DWORD
OnDrop(IDataObject
* data_object
,
44 POINT cursor_position
,
48 views::DropHelper helper_
;
50 DISALLOW_COPY_AND_ASSIGN(DropTargetWin
);
55 #endif // UI_VIEWS_WIDGET_DROP_TARGET_WIN_H_