Index: chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc |
diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc b/chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc |
index 2c289cbb1d8d25ffcae92fa29967cf51291fee75..58955a22b0cdfdafdb6deb0bb788b532d59fbb6e 100644 |
--- a/chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc |
+++ b/chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc |
@@ -312,12 +312,14 @@ void TabContentsDragWin::DoDragging(const WebDropData& drop_data, |
// 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; |
- DoDragDrop(ui::OSExchangeDataProviderWin::GetIDataObject(data), drag_source_, |
- web_drag_utils_win::WebDragOpMaskToWinDragOpMask(ops), &effect); |
- MessageLoop::current()->SetNestableTasksAllowed(old_state); |
+ { |
+ MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); |
+ DoDragDrop(ui::OSExchangeDataProviderWin::GetIDataObject(data), |
+ drag_source_, |
+ web_drag_utils_win::WebDragOpMaskToWinDragOpMask(ops), |
+ &effect); |
+ } |
// This works because WebDragSource::OnDragSourceDrop uses PostTask to |
// dispatch the actual event. |