| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/download_manager.h" | 5 #include "chrome/browser/download/download_manager.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "googleurl/src/gurl.h" | 42 #include "googleurl/src/gurl.h" |
| 43 #include "grit/generated_resources.h" | 43 #include "grit/generated_resources.h" |
| 44 #include "grit/theme_resources.h" | 44 #include "grit/theme_resources.h" |
| 45 #include "net/base/mime_util.h" | 45 #include "net/base/mime_util.h" |
| 46 #include "net/base/net_util.h" | 46 #include "net/base/net_util.h" |
| 47 | 47 |
| 48 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
| 49 #include "app/win_util.h" | 49 #include "app/win_util.h" |
| 50 #endif | 50 #endif |
| 51 | 51 |
| 52 namespace { | |
| 53 | |
| 54 // Used to sort download items based on descending start time. | |
| 55 bool CompareStartTime(DownloadItem* first, DownloadItem* second) { | |
| 56 return first->start_time() > second->start_time(); | |
| 57 } | |
| 58 | |
| 59 } // namespace | |
| 60 | |
| 61 DownloadManager::DownloadManager() | 52 DownloadManager::DownloadManager() |
| 62 : shutdown_needed_(false), | 53 : shutdown_needed_(false), |
| 63 profile_(NULL), | 54 profile_(NULL), |
| 64 file_manager_(NULL) { | 55 file_manager_(NULL) { |
| 65 } | 56 } |
| 66 | 57 |
| 67 DownloadManager::~DownloadManager() { | 58 DownloadManager::~DownloadManager() { |
| 68 DCHECK(!shutdown_needed_); | 59 DCHECK(!shutdown_needed_); |
| 69 } | 60 } |
| 70 | 61 |
| (...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 993 observed_download_manager_->RemoveObserver(this); | 984 observed_download_manager_->RemoveObserver(this); |
| 994 } | 985 } |
| 995 | 986 |
| 996 void DownloadManager::OtherDownloadManagerObserver::ModelChanged() { | 987 void DownloadManager::OtherDownloadManagerObserver::ModelChanged() { |
| 997 observing_download_manager_->NotifyModelChanged(); | 988 observing_download_manager_->NotifyModelChanged(); |
| 998 } | 989 } |
| 999 | 990 |
| 1000 void DownloadManager::OtherDownloadManagerObserver::ManagerGoingDown() { | 991 void DownloadManager::OtherDownloadManagerObserver::ManagerGoingDown() { |
| 1001 observed_download_manager_ = NULL; | 992 observed_download_manager_ = NULL; |
| 1002 } | 993 } |
| OLD | NEW |