| OLD | NEW |
| 1 // Copyright (c) 2009-2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009-2010 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/browser_thread.h" | 9 #include "chrome/browser/browser_thread.h" |
| 10 #include "chrome/browser/download/download_file.h" | 10 #include "chrome/browser/download/download_file.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 #endif | 148 #endif |
| 149 } | 149 } |
| 150 | 150 |
| 151 void DragDownloadFile::ModelChanged() { | 151 void DragDownloadFile::ModelChanged() { |
| 152 AssertCurrentlyOnUIThread(); | 152 AssertCurrentlyOnUIThread(); |
| 153 | 153 |
| 154 std::vector<DownloadItem*> downloads; | 154 std::vector<DownloadItem*> downloads; |
| 155 download_manager_->GetTemporaryDownloads(file_path_.DirName(), &downloads); | 155 download_manager_->GetTemporaryDownloads(file_path_.DirName(), &downloads); |
| 156 for (std::vector<DownloadItem*>::const_iterator i = downloads.begin(); | 156 for (std::vector<DownloadItem*>::const_iterator i = downloads.begin(); |
| 157 i != downloads.end(); ++i) { | 157 i != downloads.end(); ++i) { |
| 158 if (!download_item_observer_added_ && (*i)->url() == url_) { | 158 if (!download_item_observer_added_ && (*i)->original_url() == url_) { |
| 159 download_item_observer_added_ = true; | 159 download_item_observer_added_ = true; |
| 160 (*i)->AddObserver(this); | 160 (*i)->AddObserver(this); |
| 161 } | 161 } |
| 162 } | 162 } |
| 163 } | 163 } |
| 164 | 164 |
| 165 void DragDownloadFile::OnDownloadUpdated(DownloadItem* download) { | 165 void DragDownloadFile::OnDownloadUpdated(DownloadItem* download) { |
| 166 AssertCurrentlyOnUIThread(); | 166 AssertCurrentlyOnUIThread(); |
| 167 | 167 |
| 168 if (download->state() == DownloadItem::CANCELLED) { | 168 if (download->state() == DownloadItem::CANCELLED) { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 210 |
| 211 void DragDownloadFile::QuitNestedMessageLoop() { | 211 void DragDownloadFile::QuitNestedMessageLoop() { |
| 212 AssertCurrentlyOnDragThread(); | 212 AssertCurrentlyOnDragThread(); |
| 213 | 213 |
| 214 if (is_running_nested_message_loop_) { | 214 if (is_running_nested_message_loop_) { |
| 215 is_running_nested_message_loop_ = false; | 215 is_running_nested_message_loop_ = false; |
| 216 MessageLoop::current()->Quit(); | 216 MessageLoop::current()->Quit(); |
| 217 } | 217 } |
| 218 } | 218 } |
| 219 #endif | 219 #endif |
| OLD | NEW |