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

Unified Diff: chrome/browser/ui/browser.cc

Issue 11419169: Use DownloadItemModel for storing chrome/ specific UI data for DownloadItems. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 187682db841f6f359bb54a9f76e7c1462cf504cf..47dd0f74988eb985af0ebc04a7b2a1a266c042bb 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -1479,7 +1479,8 @@ int Browser::GetExtraRenderViewHeight() const {
void Browser::OnStartDownload(WebContents* source,
content::DownloadItem* download) {
- if (!download_util::ShouldShowInShelf(download))
+ scoped_ptr<DownloadItemModel> download_model(new DownloadItemModel(download));
+ if (!download_model->ShouldShowInShelf())
return;
WebContents* constrained = GetConstrainingWebContents(source);
@@ -1494,7 +1495,7 @@ void Browser::OnStartDownload(WebContents* source,
// GetDownloadShelf creates the download shelf if it was not yet created.
DownloadShelf* shelf = window()->GetDownloadShelf();
- shelf->AddDownload(new DownloadItemModel(download));
+ shelf->AddDownload(download_model.release());
sky 2012/12/10 18:04:52 Would be nice to use download_model.Pass() here. M
asanka 2012/12/10 18:52:14 I'll do this in a follow-up CL next.
// Don't show the animation for "Save file" downloads.
// For non-theme extensions, we don't show the download animation.
// Show animation in same window as the download shelf. Download shelf

Powered by Google App Engine
This is Rietveld 408576698