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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 // We cannot know when the target application will be done using the temporary | 256 // We cannot know when the target application will be done using the temporary |
257 // file, so schedule it to be deleted after rebooting. | 257 // file, so schedule it to be deleted after rebooting. |
258 file_util::DeleteAfterReboot(download_path); | 258 file_util::DeleteAfterReboot(download_path); |
259 file_util::DeleteAfterReboot(temp_dir_path); | 259 file_util::DeleteAfterReboot(temp_dir_path); |
260 | 260 |
261 // Provide the data as file (CF_HDROP). A temporary download file with the | 261 // Provide the data as file (CF_HDROP). A temporary download file with the |
262 // Zone.Identifier ADS (Alternate Data Stream) attached will be created. | 262 // Zone.Identifier ADS (Alternate Data Stream) attached will be created. |
263 scoped_refptr<DragDownloadFile> download_file = | 263 scoped_refptr<DragDownloadFile> download_file = |
264 new DragDownloadFile( | 264 new DragDownloadFile( |
265 download_path, | 265 download_path, |
266 scoped_ptr<net::FileStream>(NULL), | 266 scoped_ptr<net::FileStream>(), |
267 download_url, | 267 download_url, |
268 Referrer(page_url, drop_data.referrer_policy), | 268 Referrer(page_url, drop_data.referrer_policy), |
269 page_encoding, | 269 page_encoding, |
270 web_contents_); | 270 web_contents_); |
271 ui::OSExchangeData::DownloadFileInfo file_download(base::FilePath(), | 271 ui::OSExchangeData::DownloadFileInfo file_download(base::FilePath(), |
272 download_file.get()); | 272 download_file.get()); |
273 data->SetDownloadFileInfo(file_download); | 273 data->SetDownloadFileInfo(file_download); |
274 | 274 |
275 // Enable asynchronous operation. | 275 // Enable asynchronous operation. |
276 ui::OSExchangeDataProviderWin::GetIAsyncOperation(*data)->SetAsyncMode(TRUE); | 276 ui::OSExchangeDataProviderWin::GetIAsyncOperation(*data)->SetAsyncMode(TRUE); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 FROM_HERE, | 434 FROM_HERE, |
435 base::Bind(&WebContentsDragWin::CloseThread, this)); | 435 base::Bind(&WebContentsDragWin::CloseThread, this)); |
436 } | 436 } |
437 | 437 |
438 // static | 438 // static |
439 void WebContentsDragWin::DisableDragDropForTesting() { | 439 void WebContentsDragWin::DisableDragDropForTesting() { |
440 run_do_drag_drop = false; | 440 run_do_drag_drop = false; |
441 } | 441 } |
442 | 442 |
443 } // namespace content | 443 } // namespace content |
OLD | NEW |