diff options
author | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-30 20:50:51 +0000 |
---|---|---|
committer | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-30 20:50:51 +0000 |
commit | c7f4b627c4dde3c801649e28eea82e581797590c (patch) | |
tree | b1044b55a28089f8eaaa529355413fa02e0494a2 /base/base_drop_target.h | |
parent | 777c7bff9d40214069752a8ca91ade106a60536b (diff) | |
download | chromium_src-c7f4b627c4dde3c801649e28eea82e581797590c.zip chromium_src-c7f4b627c4dde3c801649e28eea82e581797590c.tar.gz chromium_src-c7f4b627c4dde3c801649e28eea82e581797590c.tar.bz2 |
Fix some issues found looking at the code.
Patch from Gaetano Mendola <mendola@gmail.com>
Original review: http://codereview.chromium.org/4273
I added some additions on my part and two unit test fix due to the added DCHECK. Reduced atl header inclusion.
Review URL: http://codereview.chromium.org/5009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2730 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/base_drop_target.h')
-rw-r--r-- | base/base_drop_target.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/base/base_drop_target.h b/base/base_drop_target.h index 1accbd1..9f20752 100644 --- a/base/base_drop_target.h +++ b/base/base_drop_target.h @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef BASE_BASE_DROP_TARGET_H__ -#define BASE_BASE_DROP_TARGET_H__ +#ifndef BASE_BASE_DROP_TARGET_H_ +#define BASE_BASE_DROP_TARGET_H_ -#include <atlbase.h> #include <objidl.h> -#include <shobjidl.h> -#include "base/basictypes.h" +#include "base/ref_counted.h" + +struct IDropTargetHelper; // A DropTarget implementation that takes care of the nitty gritty // of dnd. While this class is concrete, subclasses will most likely @@ -18,6 +18,8 @@ // Because BaseDropTarget 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 BaseDropTarget : public IDropTarget { public: // Create a new BaseDropTarget associating it with the given HWND. @@ -89,7 +91,7 @@ class BaseDropTarget : public IDropTarget { static IDropTargetHelper* DropHelper(); // The data object currently being dragged over this drop target. - CComPtr<IDataObject> current_data_object_; + 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. @@ -114,5 +116,4 @@ class BaseDropTarget : public IDropTarget { DISALLOW_EVIL_CONSTRUCTORS(BaseDropTarget); }; -#endif // BASE_BASE_DROP_TARGET_H__ - +#endif // BASE_BASE_DROP_TARGET_H_ |