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

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

Issue 464043: Reverts r4177, reimplements a fix for bug 3417. Adding UpdateObservers to Dow... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years 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 | chrome/browser/download/save_package.cc » ('j') | 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) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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 "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 state_ = CANCELLED; 235 state_ = CANCELLED;
236 UpdateObservers(); 236 UpdateObservers();
237 StopProgressTimer(); 237 StopProgressTimer();
238 if (update_history) 238 if (update_history)
239 manager_->DownloadCancelled(id_); 239 manager_->DownloadCancelled(id_);
240 } 240 }
241 241
242 void DownloadItem::Finished(int64 size) { 242 void DownloadItem::Finished(int64 size) {
243 state_ = COMPLETE; 243 state_ = COMPLETE;
244 UpdateSize(size); 244 UpdateSize(size);
245 UpdateObservers();
246 StopProgressTimer(); 245 StopProgressTimer();
247 } 246 }
248 247
249 void DownloadItem::Remove(bool delete_on_disk) { 248 void DownloadItem::Remove(bool delete_on_disk) {
250 Cancel(true); 249 Cancel(true);
251 state_ = REMOVING; 250 state_ = REMOVING;
252 if (delete_on_disk) 251 if (delete_on_disk)
253 manager_->DeleteDownload(full_path_); 252 manager_->DeleteDownload(full_path_);
254 manager_->RemoveDownload(db_handle_); 253 manager_->RemoveDownload(db_handle_);
255 // We have now been deleted. 254 // We have now been deleted.
(...skipping 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after
1580 1579
1581 if (contents) 1580 if (contents)
1582 contents->OnStartDownload(download); 1581 contents->OnStartDownload(download);
1583 } 1582 }
1584 1583
1585 // Clears the last download path, used to initialize "save as" dialogs. 1584 // Clears the last download path, used to initialize "save as" dialogs.
1586 void DownloadManager::ClearLastDownloadPath() { 1585 void DownloadManager::ClearLastDownloadPath() {
1587 last_download_path_ = FilePath(); 1586 last_download_path_ = FilePath();
1588 } 1587 }
1589 1588
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/save_package.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698