diff options
author | scottmg <scottmg@chromium.org> | 2015-02-12 20:05:37 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-13 04:06:35 +0000 |
commit | 1f77c93011af2f7d2d89c84b605dbddb2febc117 (patch) | |
tree | 5175e54df943a5144315aec2712f2186d8cfa64c /ui/base/dragdrop | |
parent | 5523a258ffe874a67e839559ae902d94b55fd69c (diff) | |
download | chromium_src-1f77c93011af2f7d2d89c84b605dbddb2febc117.zip chromium_src-1f77c93011af2f7d2d89c84b605dbddb2febc117.tar.gz chromium_src-1f77c93011af2f7d2d89c84b605dbddb2febc117.tar.bz2 |
Switch DragSourceWin to use RuntimeClass, rather than manual IUnknown
Follow up to https://codereview.chromium.org/914213003/.
R=cpu@chromium.org
BUG=390991
Review URL: https://codereview.chromium.org/894543003
Cr-Commit-Position: refs/heads/master@{#316157}
Diffstat (limited to 'ui/base/dragdrop')
-rw-r--r-- | ui/base/dragdrop/drag_source_win.cc | 21 | ||||
-rw-r--r-- | ui/base/dragdrop/drag_source_win.h | 11 |
2 files changed, 4 insertions, 28 deletions
diff --git a/ui/base/dragdrop/drag_source_win.cc b/ui/base/dragdrop/drag_source_win.cc index 1d7e9b8..292ba3e 100644 --- a/ui/base/dragdrop/drag_source_win.cc +++ b/ui/base/dragdrop/drag_source_win.cc @@ -33,27 +33,6 @@ HRESULT DragSourceWin::GiveFeedback(DWORD effect) { return DRAGDROP_S_USEDEFAULTCURSORS; } -HRESULT DragSourceWin::QueryInterface(const IID& iid, void** object) { - *object = NULL; - if (IsEqualIID(iid, IID_IUnknown) || IsEqualIID(iid, IID_IDropSource)) { - *object = this; - } else { - return E_NOINTERFACE; - } - AddRef(); - return S_OK; -} - -ULONG DragSourceWin::AddRef() { - base::RefCountedThreadSafe<DragSourceWin>::AddRef(); - return 0; -} - -ULONG DragSourceWin::Release() { - base::RefCountedThreadSafe<DragSourceWin>::Release(); - return 0; -} - void DragSourceWin::OnDragSourceDrop() { DCHECK(data_); ui::OSExchangeDataProviderWin::GetDataObjectImpl(*data_) diff --git a/ui/base/dragdrop/drag_source_win.h b/ui/base/dragdrop/drag_source_win.h index 63edef1..cba7ad5 100644 --- a/ui/base/dragdrop/drag_source_win.h +++ b/ui/base/dragdrop/drag_source_win.h @@ -6,6 +6,7 @@ #define UI_BASE_DRAGDROP_DRAG_SOURCE_WIN_H_ #include <objidl.h> +#include <wrl/implements.h> #include "base/basictypes.h" #include "base/memory/ref_counted.h" @@ -20,8 +21,9 @@ class OSExchangeData; // system. This object tells Windows whether or not the drag should continue, // and supplies the appropriate cursors. class UI_BASE_EXPORT DragSourceWin - : public IDropSource, - public base::RefCountedThreadSafe<DragSourceWin> { + : public Microsoft::WRL::RuntimeClass< + Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::ClassicCom>, + IDropSource> { public: DragSourceWin(); virtual ~DragSourceWin() {} @@ -37,11 +39,6 @@ class UI_BASE_EXPORT DragSourceWin HRESULT __stdcall QueryContinueDrag(BOOL escape_pressed, DWORD key_state); HRESULT __stdcall GiveFeedback(DWORD effect); - // IUnknown implementation: - HRESULT __stdcall QueryInterface(const IID& iid, void** object); - ULONG __stdcall AddRef(); - ULONG __stdcall Release(); - // Used to set the active data object for the current drag operation. The // caller must ensure that |data| is not destroyed before the nested drag loop // terminates. |