diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-10 23:10:42 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-10 23:10:42 +0000 |
commit | 24a4d10647ee76bae3d977caba9e8b13b5b81cf4 (patch) | |
tree | c35928b309d59b6fc60823364d4f122ca88a4c1e /base/base_drag_source.h | |
parent | ed1c9da9c46143da81c9449719b51b2b6fbc0e97 (diff) | |
download | chromium_src-24a4d10647ee76bae3d977caba9e8b13b5b81cf4.zip chromium_src-24a4d10647ee76bae3d977caba9e8b13b5b81cf4.tar.gz chromium_src-24a4d10647ee76bae3d977caba9e8b13b5b81cf4.tar.bz2 |
Fix a crash that happens if a tab is closed while
we're in the middle of a drag originating from the tab.
The problem is that the tab gets deleted out from under the
drag operation which is happening in a nested message loop.
To work around this, if we're in the middle of a drag and
we get a tab close request, delay the tab close until after
the drag operation is finished.
BUG=16280
Review URL: http://codereview.chromium.org/149466
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20436 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/base_drag_source.h')
-rw-r--r-- | base/base_drag_source.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/base/base_drag_source.h b/base/base_drag_source.h index dea89af..3a4a94c 100644 --- a/base/base_drag_source.h +++ b/base/base_drag_source.h @@ -23,6 +23,13 @@ class BaseDragSource : public IDropSource { BaseDragSource(); virtual ~BaseDragSource() { } + // Stop the drag operation at the next chance we get. This doesn't + // synchronously stop the drag (since Windows is controlling that), + // but lets us tell Windows to cancel the drag the next chance we get. + void CancelDrag() { + cancel_drag_ = true; + } + // IDropSource implementation: HRESULT __stdcall QueryContinueDrag(BOOL escape_pressed, DWORD key_state); HRESULT __stdcall GiveFeedback(DWORD effect); @@ -40,6 +47,9 @@ class BaseDragSource : public IDropSource { private: LONG ref_count_; + // Set to true if we want to cancel the drag operation. + bool cancel_drag_; + DISALLOW_EVIL_CONSTRUCTORS(BaseDragSource); }; |