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

Unified Diff: chrome/browser/views/tab_contents/tab_contents_drag_win.cc

Issue 1619023: Fix 2 drag-out problems:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 8 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 | « app/os_exchange_data_provider_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/tab_contents/tab_contents_drag_win.cc
===================================================================
--- chrome/browser/views/tab_contents/tab_contents_drag_win.cc (revision 44662)
+++ chrome/browser/views/tab_contents/tab_contents_drag_win.cc (working copy)
@@ -284,17 +284,22 @@
data.SetString(drop_data.plain_text);
}
+ // Keep a local reference to drag_source_ in case that EndDragging is called
+ // before DoDragDrop returns.
+ scoped_refptr<WebDragSource> drag_source(drag_source_);
+
// We need to enable recursive tasks on the message loop so we can get
// updates while in the system DoDragDrop loop.
bool old_state = MessageLoop::current()->NestableTasksAllowed();
+ MessageLoop::current()->SetNestableTasksAllowed(true);
DWORD effect;
- MessageLoop::current()->SetNestableTasksAllowed(true);
DoDragDrop(OSExchangeDataProviderWin::GetIDataObject(data), drag_source_,
web_drag_utils_win::WebDragOpToWinDragOp(ops), &effect);
+ MessageLoop::current()->SetNestableTasksAllowed(old_state);
+
// This works because WebDragSource::OnDragSourceDrop uses PostTask to
// dispatch the actual event.
- drag_source_->set_effect(effect);
- MessageLoop::current()->SetNestableTasksAllowed(old_state);
+ drag_source->set_effect(effect);
}
void TabContentsDragWin::EndDragging(bool restore_suspended_state) {
« no previous file with comments | « app/os_exchange_data_provider_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698