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

Unified Diff: chrome/browser/ui/views/download/download_item_view.h

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/views/download/download_item_view.h
diff --git a/chrome/browser/ui/views/download/download_item_view.h b/chrome/browser/ui/views/download/download_item_view.h
index e454ce7f9dc83c874fdf1ad76ef97caeeb6494bb..b14dddcbc1dbc0546bf47a9e54f69e8d2f2445d2 100644
--- a/chrome/browser/ui/views/download/download_item_view.h
+++ b/chrome/browser/ui/views/download/download_item_view.h
@@ -25,6 +25,7 @@
#include "base/time.h"
#include "base/timer.h"
#include "chrome/browser/common/cancelable_request.h"
+#include "chrome/browser/download/download_item_model.h"
#include "chrome/browser/icon_manager.h"
#include "content/public/browser/download_item.h"
#include "content/public/browser/download_manager.h"
@@ -34,7 +35,6 @@
#include "ui/views/controls/button/button.h"
#include "ui/views/view.h"
-class DownloadItemModel;
class DownloadShelfView;
class DownloadShelfContextMenuView;
@@ -59,8 +59,7 @@ class DownloadItemView : public views::ButtonListener,
public ui::AnimationDelegate {
public:
DownloadItemView(content::DownloadItem* download,
- DownloadShelfView* parent,
- DownloadItemModel* model);
+ DownloadShelfView* parent);
virtual ~DownloadItemView();
// Timer callback for handling animations
@@ -72,7 +71,7 @@ class DownloadItemView : public views::ButtonListener,
void OnExtractIconComplete(gfx::Image* icon);
// Returns the DownloadItem model object belonging to this item.
- content::DownloadItem* download() const { return download_; }
+ content::DownloadItem* download() { return model_.download(); }
// DownloadItem::Observer methods
virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE;
@@ -233,9 +232,6 @@ class DownloadItemView : public views::ButtonListener,
// The warning icon showns for dangerous downloads.
const gfx::ImageSkia* warning_icon_;
- // The model we query for display information
- content::DownloadItem* download_;
-
// The download shelf that owns us.
DownloadShelfView* shelf_;
@@ -283,10 +279,8 @@ class DownloadItemView : public views::ButtonListener,
// For canceling an in progress icon request.
CancelableTaskTracker cancelable_task_tracker_;
- // A model class to control the status text we display and the cancel
- // behavior.
- // This class owns the pointer.
- scoped_ptr<DownloadItemModel> model_;
+ // A model class to control the status text we display.
+ DownloadItemModel model_;
// Hover animations for our body and drop buttons.
scoped_ptr<ui::SlideAnimation> body_hover_animation_;
« no previous file with comments | « chrome/browser/ui/gtk/download/download_shelf_gtk.cc ('k') | chrome/browser/ui/views/download/download_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698