| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/tab_contents/tab_contents_drag_win.h" | 5 #include "chrome/browser/ui/views/tab_contents/tab_contents_drag_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 void TabContentsDragWin::StartDragging(const WebDropData& drop_data, | 114 void TabContentsDragWin::StartDragging(const WebDropData& drop_data, |
| 115 WebDragOperationsMask ops, | 115 WebDragOperationsMask ops, |
| 116 const SkBitmap& image, | 116 const SkBitmap& image, |
| 117 const gfx::Point& image_offset) { | 117 const gfx::Point& image_offset) { |
| 118 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 118 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 119 | 119 |
| 120 drag_source_ = new WebDragSource(view_->GetNativeView(), | 120 drag_source_ = new WebDragSource(view_->GetNativeView(), |
| 121 view_->GetTabContents()); | 121 view_->GetTabContents()); |
| 122 | 122 |
| 123 const GURL& page_url = view_->GetTabContents()->GetURL(); | 123 const GURL& page_url = view_->GetTabContents()->GetURL(); |
| 124 const std::string& page_encoding = view_->GetTabContents()->encoding(); | 124 const std::string& page_encoding = view_->GetTabContents()->GetEncoding(); |
| 125 | 125 |
| 126 // If it is not drag-out, do the drag-and-drop in the current UI thread. | 126 // If it is not drag-out, do the drag-and-drop in the current UI thread. |
| 127 if (drop_data.download_metadata.empty()) { | 127 if (drop_data.download_metadata.empty()) { |
| 128 DoDragging(drop_data, ops, page_url, page_encoding, image, image_offset); | 128 DoDragging(drop_data, ops, page_url, page_encoding, image, image_offset); |
| 129 EndDragging(false); | 129 EndDragging(false); |
| 130 return; | 130 return; |
| 131 } | 131 } |
| 132 | 132 |
| 133 // We do not want to drag and drop the download to itself. | 133 // We do not want to drag and drop the download to itself. |
| 134 old_drop_target_suspended_state_ = view_->drop_target()->suspended(); | 134 old_drop_target_suspended_state_ = view_->drop_target()->suspended(); |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 void TabContentsDragWin::OnDataObjectDisposed() { | 361 void TabContentsDragWin::OnDataObjectDisposed() { |
| 362 DCHECK(drag_drop_thread_id_ == base::PlatformThread::CurrentId()); | 362 DCHECK(drag_drop_thread_id_ == base::PlatformThread::CurrentId()); |
| 363 | 363 |
| 364 // The drag-and-drop thread is only closed after OLE is done with | 364 // The drag-and-drop thread is only closed after OLE is done with |
| 365 // DataObjectImpl. | 365 // DataObjectImpl. |
| 366 BrowserThread::PostTask( | 366 BrowserThread::PostTask( |
| 367 BrowserThread::UI, | 367 BrowserThread::UI, |
| 368 FROM_HERE, | 368 FROM_HERE, |
| 369 base::Bind(&TabContentsDragWin::CloseThread, this)); | 369 base::Bind(&TabContentsDragWin::CloseThread, this)); |
| 370 } | 370 } |
| OLD | NEW |