OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_BASE_DRAGDROP_DROP_TARGET_WIN_H_ | 5 #ifndef UI_BASE_DRAGDROP_DROP_TARGET_WIN_H_ |
6 #define UI_BASE_DRAGDROP_DROP_TARGET_WIN_H_ | 6 #define UI_BASE_DRAGDROP_DROP_TARGET_WIN_H_ |
7 | 7 |
8 #include <objidl.h> | 8 #include <objidl.h> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "ui/base/ui_export.h" | 11 #include "ui/base/ui_base_export.h" |
12 | 12 |
13 // Windows interface. | 13 // Windows interface. |
14 struct IDropTargetHelper; | 14 struct IDropTargetHelper; |
15 | 15 |
16 namespace ui { | 16 namespace ui { |
17 | 17 |
18 // A DropTarget implementation that takes care of the nitty gritty | 18 // A DropTarget implementation that takes care of the nitty gritty |
19 // of dnd. While this class is concrete, subclasses will most likely | 19 // of dnd. While this class is concrete, subclasses will most likely |
20 // want to override various OnXXX methods. | 20 // want to override various OnXXX methods. |
21 // | 21 // |
22 // Because DropTarget is ref counted you shouldn't delete it directly, | 22 // Because DropTarget is ref counted you shouldn't delete it directly, |
23 // rather wrap it in a scoped_refptr. Be sure and invoke RevokeDragDrop(m_hWnd) | 23 // rather wrap it in a scoped_refptr. Be sure and invoke RevokeDragDrop(m_hWnd) |
24 // before the HWND is deleted too. | 24 // before the HWND is deleted too. |
25 // | 25 // |
26 // This class is meant to be used in a STA and is not multithread-safe. | 26 // This class is meant to be used in a STA and is not multithread-safe. |
27 class UI_EXPORT DropTargetWin : public IDropTarget { | 27 class UI_BASE_EXPORT DropTargetWin : public IDropTarget { |
28 public: | 28 public: |
29 // Create a new DropTarget associating it with the given HWND. | 29 // Create a new DropTarget associating it with the given HWND. |
30 explicit DropTargetWin(HWND hwnd); | 30 explicit DropTargetWin(HWND hwnd); |
31 virtual ~DropTargetWin(); | 31 virtual ~DropTargetWin(); |
32 | 32 |
33 // IDropTarget implementation: | 33 // IDropTarget implementation: |
34 HRESULT __stdcall DragEnter(IDataObject* data_object, | 34 HRESULT __stdcall DragEnter(IDataObject* data_object, |
35 DWORD key_state, | 35 DWORD key_state, |
36 POINTL cursor_position, | 36 POINTL cursor_position, |
37 DWORD* effect); | 37 DWORD* effect); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 HWND hwnd_; | 105 HWND hwnd_; |
106 | 106 |
107 LONG ref_count_; | 107 LONG ref_count_; |
108 | 108 |
109 DISALLOW_COPY_AND_ASSIGN(DropTargetWin); | 109 DISALLOW_COPY_AND_ASSIGN(DropTargetWin); |
110 }; | 110 }; |
111 | 111 |
112 } // namespace ui | 112 } // namespace ui |
113 | 113 |
114 #endif // UI_BASE_DRAGDROP_DROP_TARGET_WIN_H_ | 114 #endif // UI_BASE_DRAGDROP_DROP_TARGET_WIN_H_ |
OLD | NEW |