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

Side by Side Diff: content/browser/download/download_manager_impl.cc

Issue 10831412: Added some cancel/close tab tests to SavePackage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporated some comments. Created 8 years, 4 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 | « chrome/browser/download/save_page_browsertest.cc ('k') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/download/download_manager_impl.h" 5 #include "content/browser/download/download_manager_impl.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 bound_net_log); 552 bound_net_log);
553 553
554 download->AddObserver(observer); 554 download->AddObserver(observer);
555 555
556 DCHECK(!ContainsKey(downloads_, download->GetId())); 556 DCHECK(!ContainsKey(downloads_, download->GetId()));
557 downloads_[download->GetId()] = download; 557 downloads_[download->GetId()] = download;
558 DCHECK(!SavePageData::Get(download)); 558 DCHECK(!SavePageData::Get(download));
559 new SavePageData(download); 559 new SavePageData(download);
560 DCHECK(SavePageData::Get(download)); 560 DCHECK(SavePageData::Get(download));
561 561
562 // TODO(benjhayden): Fire OnDownloadCreated for SavePackage downloads when 562 FOR_EACH_OBSERVER(Observer, observers_, OnDownloadCreated(this, download));
563 // we're comfortable with the user interacting with them.
564 // FOR_EACH_OBSERVER(Observer, observers_, OnDownloadCreated(this, download));
565 563
566 // Will notify the observer in the callback. 564 // Will notify the observer in the callback.
567 if (delegate_) 565 if (delegate_)
568 delegate_->AddItemToPersistentStore(download); 566 delegate_->AddItemToPersistentStore(download);
569 567
570 return download; 568 return download;
571 } 569 }
572 570
573 void DownloadManagerImpl::UpdateDownload(int32 download_id, 571 void DownloadManagerImpl::UpdateDownload(int32 download_id,
574 int64 bytes_so_far, 572 int64 bytes_so_far,
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 void DownloadManagerImpl::DownloadRenamedToFinalName( 1090 void DownloadManagerImpl::DownloadRenamedToFinalName(
1093 DownloadItemImpl* download) { 1091 DownloadItemImpl* download) {
1094 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1092 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1095 // If the rename failed, we receive an OnDownloadInterrupted() call before we 1093 // If the rename failed, we receive an OnDownloadInterrupted() call before we
1096 // receive the DownloadRenamedToFinalName() call. 1094 // receive the DownloadRenamedToFinalName() call.
1097 if (delegate_) { 1095 if (delegate_) {
1098 delegate_->UpdatePathForItemInPersistentStore( 1096 delegate_->UpdatePathForItemInPersistentStore(
1099 download, download->GetFullPath()); 1097 download, download->GetFullPath());
1100 } 1098 }
1101 } 1099 }
OLDNEW
« no previous file with comments | « chrome/browser/download/save_page_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698