Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Side by Side Diff: chrome/browser/download/download_manager.cc

Issue 6312027: Add files saved using 'Save page as' to the download history.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/download_manager.h" 5 #include "chrome/browser/download/download_manager.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 profile_->GetOriginalProfile()->GetDownloadManager()->RemoveAllDownloads(); 824 profile_->GetOriginalProfile()->GetDownloadManager()->RemoveAllDownloads();
825 } 825 }
826 // The null times make the date range unbounded. 826 // The null times make the date range unbounded.
827 return RemoveDownloadsBetween(base::Time(), base::Time()); 827 return RemoveDownloadsBetween(base::Time(), base::Time());
828 } 828 }
829 829
830 void DownloadManager::SavePageAsDownloadStarted(DownloadItem* download_item) { 830 void DownloadManager::SavePageAsDownloadStarted(DownloadItem* download_item) {
831 #if !defined(NDEBUG) 831 #if !defined(NDEBUG)
832 save_page_as_downloads_.insert(download_item); 832 save_page_as_downloads_.insert(download_item);
833 #endif 833 #endif
834 // Assign a fake db handle if it is uninitialized. The history cannot hold
835 // multiple DownloadItems with the same handle.
836 int64 db_handle = download_item->db_handle();
837 if (db_handle == DownloadHistory::kUninitializedHandle)
838 db_handle = download_history_->GetNextFakeDbHandle();
839 download_item->set_db_handle(db_handle);
Paweł Hajdan Jr. 2011/01/31 08:32:19 nit: Could you put it inside the "if"?
840
841 history_downloads_[download_item->db_handle()] = download_item;
Paweł Hajdan Jr. 2011/01/31 08:32:19 nit: Should be sufficient to just use db_handle he
834 downloads_.insert(download_item); 842 downloads_.insert(download_item);
835 } 843 }
836 844
837 // Initiate a download of a specific URL. We send the request to the 845 // Initiate a download of a specific URL. We send the request to the
838 // ResourceDispatcherHost, and let it send us responses like a regular 846 // ResourceDispatcherHost, and let it send us responses like a regular
839 // download. 847 // download.
840 void DownloadManager::DownloadUrl(const GURL& url, 848 void DownloadManager::DownloadUrl(const GURL& url,
841 const GURL& referrer, 849 const GURL& referrer,
842 const std::string& referrer_charset, 850 const std::string& referrer_charset,
843 TabContents* tab_contents) { 851 TabContents* tab_contents) {
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
1129 observed_download_manager_->RemoveObserver(this); 1137 observed_download_manager_->RemoveObserver(this);
1130 } 1138 }
1131 1139
1132 void DownloadManager::OtherDownloadManagerObserver::ModelChanged() { 1140 void DownloadManager::OtherDownloadManagerObserver::ModelChanged() {
1133 observing_download_manager_->NotifyModelChanged(); 1141 observing_download_manager_->NotifyModelChanged();
1134 } 1142 }
1135 1143
1136 void DownloadManager::OtherDownloadManagerObserver::ManagerGoingDown() { 1144 void DownloadManager::OtherDownloadManagerObserver::ManagerGoingDown() {
1137 observed_download_manager_ = NULL; 1145 observed_download_manager_ = NULL;
1138 } 1146 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698