| 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/download/drag_download_file.h" | 5 #include "chrome/browser/download/drag_download_file.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "chrome/browser/download/download_file.h" | 9 #include "chrome/browser/download/download_file.h" |
| 10 #include "chrome/browser/download/download_item.h" | 10 #include "chrome/browser/download/download_item.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // DownloadManager could only be invoked from the UI thread. | 110 // DownloadManager could only be invoked from the UI thread. |
| 111 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { | 111 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
| 112 BrowserThread::PostTask( | 112 BrowserThread::PostTask( |
| 113 BrowserThread::UI, FROM_HERE, | 113 BrowserThread::UI, FROM_HERE, |
| 114 NewRunnableMethod(this, | 114 NewRunnableMethod(this, |
| 115 &DragDownloadFile::InitiateDownload)); | 115 &DragDownloadFile::InitiateDownload)); |
| 116 return; | 116 return; |
| 117 } | 117 } |
| 118 #endif | 118 #endif |
| 119 | 119 |
| 120 download_manager_ = tab_contents_->profile()->GetDownloadManager(); | 120 download_manager_ = tab_contents_->context()->GetDownloadManager(); |
| 121 download_manager_observer_added_ = true; | 121 download_manager_observer_added_ = true; |
| 122 download_manager_->AddObserver(this); | 122 download_manager_->AddObserver(this); |
| 123 | 123 |
| 124 DownloadSaveInfo save_info; | 124 DownloadSaveInfo save_info; |
| 125 save_info.file_path = file_path_; | 125 save_info.file_path = file_path_; |
| 126 save_info.file_stream = file_stream_; | 126 save_info.file_stream = file_stream_; |
| 127 download_manager_->DownloadUrlToFile(url_, | 127 download_manager_->DownloadUrlToFile(url_, |
| 128 referrer_, | 128 referrer_, |
| 129 referrer_encoding_, | 129 referrer_encoding_, |
| 130 save_info, | 130 save_info, |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 | 221 |
| 222 void DragDownloadFile::QuitNestedMessageLoop() { | 222 void DragDownloadFile::QuitNestedMessageLoop() { |
| 223 AssertCurrentlyOnDragThread(); | 223 AssertCurrentlyOnDragThread(); |
| 224 | 224 |
| 225 if (is_running_nested_message_loop_) { | 225 if (is_running_nested_message_loop_) { |
| 226 is_running_nested_message_loop_ = false; | 226 is_running_nested_message_loop_ = false; |
| 227 MessageLoop::current()->Quit(); | 227 MessageLoop::current()->Quit(); |
| 228 } | 228 } |
| 229 } | 229 } |
| 230 #endif | 230 #endif |
| OLD | NEW |