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

Unified Diff: chrome/browser/download/chrome_download_manager_delegate.cc

Issue 10805020: Kill DownloadItem::IsOtr() (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: . Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/download/chrome_download_manager_delegate.cc
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc
index cffda03ad2b7a856484b3d81265c9f8a7179a5dd..4e5fbce419aaafd1ee86793ff705c76c1ac38fa7 100644
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -409,6 +409,12 @@ bool ChromeDownloadManagerDelegate::GenerateFileHash() {
void ChromeDownloadManagerDelegate::AddItemToPersistentStore(
DownloadItem* item) {
+ if (profile_->HasOffTheRecordProfile() &&
+ (profile_ == profile_->GetOffTheRecordProfile())) {
+ OnItemAddedToPersistentStore(
+ item->GetId(), download_history_->GetNextFakeDbHandle());
+ return;
+ }
Randy Smith (Not in Mondays) 2012/07/23 18:19:26 Why not in DownloadHistory? That feels like a cla
download_history_->AddEntry(item,
base::Bind(&ChromeDownloadManagerDelegate::OnItemAddedToPersistentStore,
base::Unretained(this)));
@@ -433,6 +439,9 @@ void ChromeDownloadManagerDelegate::RemoveItemFromPersistentStore(
void ChromeDownloadManagerDelegate::RemoveItemsFromPersistentStoreBetween(
base::Time remove_begin,
base::Time remove_end) {
+ if (profile_->HasOffTheRecordProfile() &&
+ (profile_ == profile_->GetOffTheRecordProfile()))
+ return;
download_history_->RemoveEntriesBetween(remove_begin, remove_end);
}

Powered by Google App Engine
This is Rietveld 408576698