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

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

Issue 11673004: No need to pass DownloadItemModel ownership. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DownloadShelfContextMenu class cleanup and require GetMenuModel() to return non-NULL Created 7 years, 11 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/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 08019724638feb4bba451acccd367ed1f1cd2e86..055b83e2d6d7e02d3ea641416d04c535fde478c7 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -1494,8 +1494,7 @@ int Browser::GetExtraRenderViewHeight() const {
void Browser::OnStartDownload(WebContents* source,
content::DownloadItem* download) {
- scoped_ptr<DownloadItemModel> download_model(new DownloadItemModel(download));
- if (!download_model->ShouldShowInShelf())
+ if (!DownloadItemModel(download).ShouldShowInShelf())
return;
WebContents* constrained = GetConstrainingWebContents(source);
@@ -1510,7 +1509,7 @@ void Browser::OnStartDownload(WebContents* source,
// GetDownloadShelf creates the download shelf if it was not yet created.
DownloadShelf* shelf = window()->GetDownloadShelf();
- shelf->AddDownload(download_model.release());
+ shelf->AddDownload(download);
// 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
« no previous file with comments | « chrome/browser/download/test_download_shelf.cc ('k') | chrome/browser/ui/cocoa/download/download_item_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698