| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <time.h> | 5 #include <time.h> |
| 6 | 6 |
| 7 #include "chrome/browser/download/download_manager.h" | 7 #include "chrome/browser/download/download_manager.h" |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "chrome/common/pref_service.h" | 34 #include "chrome/common/pref_service.h" |
| 35 #include "chrome/common/stl_util-inl.h" | 35 #include "chrome/common/stl_util-inl.h" |
| 36 #include "chrome/common/win_util.h" | 36 #include "chrome/common/win_util.h" |
| 37 #include "googleurl/src/gurl.h" | 37 #include "googleurl/src/gurl.h" |
| 38 #include "net/base/mime_util.h" | 38 #include "net/base/mime_util.h" |
| 39 #include "net/base/net_util.h" | 39 #include "net/base/net_util.h" |
| 40 #include "net/url_request/url_request_context.h" | 40 #include "net/url_request/url_request_context.h" |
| 41 | 41 |
| 42 #include "generated_resources.h" | 42 #include "generated_resources.h" |
| 43 | 43 |
| 44 using base::Time; |
| 45 using base::TimeDelta; |
| 46 |
| 44 // Periodically update our observers. | 47 // Periodically update our observers. |
| 45 class DownloadItemUpdateTask : public Task { | 48 class DownloadItemUpdateTask : public Task { |
| 46 public: | 49 public: |
| 47 explicit DownloadItemUpdateTask(DownloadItem* item) : item_(item) {} | 50 explicit DownloadItemUpdateTask(DownloadItem* item) : item_(item) {} |
| 48 void Run() { if (item_) item_->UpdateObservers(); } | 51 void Run() { if (item_) item_->UpdateObservers(); } |
| 49 | 52 |
| 50 private: | 53 private: |
| 51 DownloadItem* item_; | 54 DownloadItem* item_; |
| 52 }; | 55 }; |
| 53 | 56 |
| (...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1316 std::vector<DownloadItem*> searched_downloads; | 1319 std::vector<DownloadItem*> searched_downloads; |
| 1317 for (std::vector<int64>::iterator it = results->begin(); | 1320 for (std::vector<int64>::iterator it = results->begin(); |
| 1318 it != results->end(); ++it) { | 1321 it != results->end(); ++it) { |
| 1319 DownloadMap::iterator dit = downloads_.find(*it); | 1322 DownloadMap::iterator dit = downloads_.find(*it); |
| 1320 if (dit != downloads_.end()) | 1323 if (dit != downloads_.end()) |
| 1321 searched_downloads.push_back(dit->second); | 1324 searched_downloads.push_back(dit->second); |
| 1322 } | 1325 } |
| 1323 | 1326 |
| 1324 requestor->SetDownloads(searched_downloads); | 1327 requestor->SetDownloads(searched_downloads); |
| 1325 } | 1328 } |
| 1326 | |
| OLD | NEW |