Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / ui / views / widget / desktop_aura / desktop_drag_drop_client_win.h
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.
4
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_
7
8 #include "base/compiler_specific.h"
9 #include "base/memory/ref_counted.h"
10 #include "ui/views/views_export.h"
11 #include "ui/wm/public/drag_drop_client.h"
12
13 namespace ui {
14 class DragSourceWin;
15 }
16
17 namespace views {
18 class DesktopDropTargetWin;
19
20 class VIEWS_EXPORT DesktopDragDropClientWin
21     : public aura::client::DragDropClient {
22  public:
23   DesktopDragDropClientWin(aura::Window* root_window, HWND window);
24   virtual ~DesktopDragDropClientWin();
25
26   // Overridden from aura::client::DragDropClient:
27   virtual int StartDragAndDrop(
28       const ui::OSExchangeData& data,
29       aura::Window* root_window,
30       aura::Window* source_window,
31       const gfx::Point& root_location,
32       int operation,
33       ui::DragDropTypes::DragEventSource source) override;
34   virtual void DragUpdate(aura::Window* target,
35                           const ui::LocatedEvent& event) override;
36   virtual void Drop(aura::Window* target,
37                     const ui::LocatedEvent& event) override;
38   virtual void DragCancel() override;
39   virtual bool IsDragDropInProgress() override;
40
41   void OnNativeWidgetDestroying(HWND window);
42
43  private:
44   bool drag_drop_in_progress_;
45
46   int drag_operation_;
47
48   scoped_refptr<ui::DragSourceWin> drag_source_;
49
50   scoped_refptr<DesktopDropTargetWin> drop_target_;
51
52   DISALLOW_COPY_AND_ASSIGN(DesktopDragDropClientWin);
53 };
54
55 }  // namespace views
56
57 #endif  // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_DRAG_DROP_CLIENT_WIN_H_