OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/web_contents/web_contents_drag_win.h" | 5 #include "content/browser/web_contents/web_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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 FilePath generated_download_file_name = | 243 FilePath generated_download_file_name = |
244 net::GenerateFileName(download_url, | 244 net::GenerateFileName(download_url, |
245 std::string(), | 245 std::string(), |
246 std::string(), | 246 std::string(), |
247 UTF16ToUTF8(file_name.value()), | 247 UTF16ToUTF8(file_name.value()), |
248 UTF16ToUTF8(mime_type), | 248 UTF16ToUTF8(mime_type), |
249 default_name); | 249 default_name); |
250 | 250 |
251 // Provide the data as file (CF_HDROP). A temporary download file with the | 251 // Provide the data as file (CF_HDROP). A temporary download file with the |
252 // Zone.Identifier ADS (Alternate Data Stream) attached will be created. | 252 // Zone.Identifier ADS (Alternate Data Stream) attached will be created. |
253 linked_ptr<net::FileStream> empty_file_stream; | |
254 scoped_refptr<DragDownloadFile> download_file = | 253 scoped_refptr<DragDownloadFile> download_file = |
255 new DragDownloadFile( | 254 new DragDownloadFile( |
256 generated_download_file_name, | 255 generated_download_file_name, |
257 empty_file_stream, | 256 scoped_ptr<net::FileStream>(), |
258 download_url, | 257 download_url, |
259 content::Referrer(page_url, drop_data.referrer_policy), | 258 content::Referrer(page_url, drop_data.referrer_policy), |
260 page_encoding, | 259 page_encoding, |
261 web_contents_); | 260 web_contents_); |
262 ui::OSExchangeData::DownloadFileInfo file_download(FilePath(), | 261 ui::OSExchangeData::DownloadFileInfo file_download(FilePath(), |
263 download_file.get()); | 262 download_file.get()); |
264 data->SetDownloadFileInfo(file_download); | 263 data->SetDownloadFileInfo(file_download); |
265 | 264 |
266 // Enable asynchronous operation. | 265 // Enable asynchronous operation. |
267 ui::OSExchangeDataProviderWin::GetIAsyncOperation(*data)->SetAsyncMode(TRUE); | 266 ui::OSExchangeDataProviderWin::GetIAsyncOperation(*data)->SetAsyncMode(TRUE); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 void WebContentsDragWin::OnDataObjectDisposed() { | 414 void WebContentsDragWin::OnDataObjectDisposed() { |
416 DCHECK(drag_drop_thread_id_ == base::PlatformThread::CurrentId()); | 415 DCHECK(drag_drop_thread_id_ == base::PlatformThread::CurrentId()); |
417 | 416 |
418 // The drag-and-drop thread is only closed after OLE is done with | 417 // The drag-and-drop thread is only closed after OLE is done with |
419 // DataObjectImpl. | 418 // DataObjectImpl. |
420 BrowserThread::PostTask( | 419 BrowserThread::PostTask( |
421 BrowserThread::UI, | 420 BrowserThread::UI, |
422 FROM_HERE, | 421 FROM_HERE, |
423 base::Bind(&WebContentsDragWin::CloseThread, this)); | 422 base::Bind(&WebContentsDragWin::CloseThread, this)); |
424 } | 423 } |
OLD | NEW |