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 "base/compiler_specific.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/weak_ptr.h"
11 #include "ui/views/views_export.h"
12 #include "ui/wm/public/drag_drop_client.h"
19 class DesktopDropTargetWin
;
21 class VIEWS_EXPORT DesktopDragDropClientWin
22 : public aura::client::DragDropClient
{
24 DesktopDragDropClientWin(aura::Window
* root_window
, HWND window
);
25 virtual ~DesktopDragDropClientWin();
27 // Overridden from aura::client::DragDropClient:
28 virtual int StartDragAndDrop(
29 const ui::OSExchangeData
& data
,
30 aura::Window
* root_window
,
31 aura::Window
* source_window
,
32 const gfx::Point
& root_location
,
34 ui::DragDropTypes::DragEventSource source
) override
;
35 virtual void DragUpdate(aura::Window
* target
,
36 const ui::LocatedEvent
& event
) override
;
37 virtual void Drop(aura::Window
* target
,
38 const ui::LocatedEvent
& event
) override
;
39 virtual void DragCancel() override
;
40 virtual bool IsDragDropInProgress() override
;
42 void OnNativeWidgetDestroying(HWND window
);
45 bool drag_drop_in_progress_
;
49 scoped_refptr
<ui::DragSourceWin
> drag_source_
;
51 scoped_refptr
<DesktopDropTargetWin
> drop_target_
;
53 base::WeakPtrFactory
<DesktopDragDropClientWin
> weak_factory_
;
55 DISALLOW_COPY_AND_ASSIGN(DesktopDragDropClientWin
);
60 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_DRAG_DROP_CLIENT_WIN_H_