1 // Copyright (c) 2012 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_DESKTOP_AURA_DESKTOP_DRAG_DROP_CLIENT_WIN_H_
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_DRAG_DROP_CLIENT_WIN_H_
8 #include <wrl/client.h>
10 #include "base/compiler_specific.h"
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/weak_ptr.h"
13 #include "ui/views/views_export.h"
14 #include "ui/wm/public/drag_drop_client.h"
21 class DesktopDropTargetWin
;
23 class VIEWS_EXPORT DesktopDragDropClientWin
24 : public aura::client::DragDropClient
{
26 DesktopDragDropClientWin(aura::Window
* root_window
, HWND window
);
27 ~DesktopDragDropClientWin() override
;
29 // Overridden from aura::client::DragDropClient:
30 int StartDragAndDrop(const ui::OSExchangeData
& data
,
31 aura::Window
* root_window
,
32 aura::Window
* source_window
,
33 const gfx::Point
& screen_location
,
35 ui::DragDropTypes::DragEventSource source
) override
;
36 void DragUpdate(aura::Window
* target
, const ui::LocatedEvent
& event
) override
;
37 void Drop(aura::Window
* target
, const ui::LocatedEvent
& event
) override
;
38 void DragCancel() override
;
39 bool IsDragDropInProgress() override
;
41 void OnNativeWidgetDestroying(HWND window
);
44 bool drag_drop_in_progress_
;
48 Microsoft::WRL::ComPtr
<ui::DragSourceWin
> drag_source_
;
50 scoped_refptr
<DesktopDropTargetWin
> drop_target_
;
52 base::WeakPtrFactory
<DesktopDragDropClientWin
> weak_factory_
;
54 DISALLOW_COPY_AND_ASSIGN(DesktopDragDropClientWin
);
59 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_DRAG_DROP_CLIENT_WIN_H_