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/download/drag_download_file.h" | 5 #include "content/browser/download/drag_download_file.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "content/browser/download/download_stats.h" | 10 #include "content/browser/download/download_stats.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 download_manager_->AddObserver(this); | 130 download_manager_->AddObserver(this); |
131 | 131 |
132 DownloadSaveInfo save_info; | 132 DownloadSaveInfo save_info; |
133 save_info.file_path = file_path_; | 133 save_info.file_path = file_path_; |
134 save_info.file_stream = file_stream_; | 134 save_info.file_stream = file_stream_; |
135 | 135 |
136 download_manager_->DownloadUrl(url_, | 136 download_manager_->DownloadUrl(url_, |
137 referrer_, | 137 referrer_, |
138 referrer_encoding_, | 138 referrer_encoding_, |
139 false, | 139 false, |
| 140 -1, |
140 save_info, | 141 save_info, |
141 web_contents_); | 142 web_contents_); |
142 download_stats::RecordDownloadCount( | 143 download_stats::RecordDownloadCount( |
143 download_stats::INITIATED_BY_DRAG_N_DROP_COUNT); | 144 download_stats::INITIATED_BY_DRAG_N_DROP_COUNT); |
144 } | 145 } |
145 | 146 |
146 void DragDownloadFile::DownloadCompleted(bool is_successful) { | 147 void DragDownloadFile::DownloadCompleted(bool is_successful) { |
147 #if defined(OS_WIN) | 148 #if defined(OS_WIN) |
148 // If not in drag-and-drop thread, defer the running to it. | 149 // If not in drag-and-drop thread, defer the running to it. |
149 if (drag_message_loop_ != MessageLoop::current()) { | 150 if (drag_message_loop_ != MessageLoop::current()) { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 | 232 |
232 void DragDownloadFile::QuitNestedMessageLoop() { | 233 void DragDownloadFile::QuitNestedMessageLoop() { |
233 AssertCurrentlyOnDragThread(); | 234 AssertCurrentlyOnDragThread(); |
234 | 235 |
235 if (is_running_nested_message_loop_) { | 236 if (is_running_nested_message_loop_) { |
236 is_running_nested_message_loop_ = false; | 237 is_running_nested_message_loop_ = false; |
237 MessageLoop::current()->Quit(); | 238 MessageLoop::current()->Quit(); |
238 } | 239 } |
239 } | 240 } |
240 #endif | 241 #endif |
OLD | NEW |