Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(727)

Unified Diff: ui/base/dragdrop/drop_target_win.h

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/dragdrop/drop_target_event.cc ('k') | ui/base/dragdrop/drop_target_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/dragdrop/drop_target_win.h
diff --git a/ui/base/dragdrop/drop_target_win.h b/ui/base/dragdrop/drop_target_win.h
deleted file mode 100644
index 4536f1d6aa6ce5c95838ffe32f2a2b29a0843b02..0000000000000000000000000000000000000000
--- a/ui/base/dragdrop/drop_target_win.h
+++ /dev/null
@@ -1,114 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef UI_BASE_DRAGDROP_DROP_TARGET_WIN_H_
-#define UI_BASE_DRAGDROP_DROP_TARGET_WIN_H_
-
-#include <objidl.h>
-
-#include "base/memory/ref_counted.h"
-#include "ui/base/ui_base_export.h"
-
-// Windows interface.
-struct IDropTargetHelper;
-
-namespace ui {
-
-// A DropTarget implementation that takes care of the nitty gritty
-// of dnd. While this class is concrete, subclasses will most likely
-// want to override various OnXXX methods.
-//
-// Because DropTarget is ref counted you shouldn't delete it directly,
-// rather wrap it in a scoped_refptr. Be sure and invoke RevokeDragDrop(m_hWnd)
-// before the HWND is deleted too.
-//
-// This class is meant to be used in a STA and is not multithread-safe.
-class UI_BASE_EXPORT DropTargetWin : public IDropTarget {
- public:
- // Create a new DropTarget associating it with the given HWND.
- explicit DropTargetWin(HWND hwnd);
- virtual ~DropTargetWin();
-
- // IDropTarget implementation:
- HRESULT __stdcall DragEnter(IDataObject* data_object,
- DWORD key_state,
- POINTL cursor_position,
- DWORD* effect);
- HRESULT __stdcall DragOver(DWORD key_state,
- POINTL cursor_position,
- DWORD* effect);
- HRESULT __stdcall DragLeave();
- HRESULT __stdcall Drop(IDataObject* data_object,
- DWORD key_state,
- POINTL cursor_position,
- DWORD* effect);
-
- // IUnknown implementation:
- HRESULT __stdcall QueryInterface(const IID& iid, void** object);
- ULONG __stdcall AddRef();
- ULONG __stdcall Release();
-
- protected:
- // Returns the hosting HWND.
- HWND GetHWND() { return hwnd_; }
-
- // Invoked when the cursor first moves over the hwnd during a dnd session.
- // This should return a bitmask of the supported drop operations:
- // DROPEFFECT_NONE, DROPEFFECT_COPY, DROPEFFECT_LINK and/or
- // DROPEFFECT_MOVE.
- virtual DWORD OnDragEnter(IDataObject* data_object,
- DWORD key_state,
- POINT cursor_position,
- DWORD effect);
-
- // Invoked when the cursor moves over the window during a dnd session.
- // This should return a bitmask of the supported drop operations:
- // DROPEFFECT_NONE, DROPEFFECT_COPY, DROPEFFECT_LINK and/or
- // DROPEFFECT_MOVE.
- virtual DWORD OnDragOver(IDataObject* data_object,
- DWORD key_state,
- POINT cursor_position,
- DWORD effect);
-
- // Invoked when the cursor moves outside the bounds of the hwnd during a
- // dnd session.
- virtual void OnDragLeave(IDataObject* data_object);
-
- // Invoked when the drop ends on the window. This should return the operation
- // that was taken.
- virtual DWORD OnDrop(IDataObject* data_object,
- DWORD key_state,
- POINT cursor_position,
- DWORD effect);
-
- private:
- // Returns the cached drop helper, creating one if necessary. The returned
- // object is not addrefed. May return NULL if the object couldn't be created.
- static IDropTargetHelper* DropHelper();
-
- // The data object currently being dragged over this drop target.
- scoped_refptr<IDataObject> current_data_object_;
-
- // A helper object that is used to provide drag image support while the mouse
- // is dragging over the content area.
- //
- // DO NOT ACCESS DIRECTLY! Use DropHelper() instead, which will lazily create
- // this if it doesn't exist yet. This object can take tens of milliseconds to
- // create, and we don't want to block any window opening for this, especially
- // since often, DnD will never be used. Instead, we force this penalty to the
- // first time it is actually used.
- static IDropTargetHelper* cached_drop_target_helper_;
-
- // The HWND of the source. This HWND is used to determine coordinates for
- // mouse events that are sent to the renderer notifying various drag states.
- HWND hwnd_;
-
- LONG ref_count_;
-
- DISALLOW_COPY_AND_ASSIGN(DropTargetWin);
-};
-
-} // namespace ui
-
-#endif // UI_BASE_DRAGDROP_DROP_TARGET_WIN_H_
« no previous file with comments | « ui/base/dragdrop/drop_target_event.cc ('k') | ui/base/dragdrop/drop_target_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698