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

Unified Diff: chrome/browser/ui/gtk/download/download_item_gtk.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/gtk/download/download_item_gtk.h
diff --git a/chrome/browser/ui/gtk/download/download_item_gtk.h b/chrome/browser/ui/gtk/download/download_item_gtk.h
index 0efcab4319c9814d3d4e255b6934eb5e5733f89d..e659a7da5433c055dede22e89bbded2fa936dbf0 100644
--- a/chrome/browser/ui/gtk/download/download_item_gtk.h
+++ b/chrome/browser/ui/gtk/download/download_item_gtk.h
@@ -14,6 +14,7 @@
#include "base/memory/weak_ptr.h"
#include "base/time.h"
#include "base/timer.h"
+#include "chrome/browser/download/download_item_model.h"
#include "chrome/browser/icon_manager.h"
#include "chrome/common/cancelable_task_tracker.h"
#include "content/public/browser/download_item.h"
@@ -24,7 +25,6 @@
#include "ui/base/gtk/gtk_signal.h"
#include "ui/base/gtk/owned_widget_gtk.h"
-class DownloadItemModel;
class DownloadShelfContextMenuGtk;
class DownloadShelfGtk;
class GtkThemeService;
@@ -44,7 +44,7 @@ class DownloadItemGtk : public content::DownloadItem::Observer,
public:
// DownloadItemGtk takes ownership of |download_item_model|.
DownloadItemGtk(DownloadShelfGtk* parent_shelf,
- DownloadItemModel* download_item_model);
+ content::DownloadItem* download_item);
// Destroys all widgets belonging to this DownloadItemGtk.
virtual ~DownloadItemGtk();
@@ -68,7 +68,7 @@ class DownloadItemGtk : public content::DownloadItem::Observer,
void OnLoadLargeIconComplete(gfx::Image* image);
// Returns the DownloadItem model object belonging to this item.
- content::DownloadItem* get_download();
+ content::DownloadItem* download() { return download_model_.download(); }
private:
friend class DownloadShelfContextMenuGtk;
@@ -199,7 +199,7 @@ class DownloadItemGtk : public content::DownloadItem::Observer,
scoped_ptr<DownloadShelfContextMenuGtk> menu_;
// The download item model we represent.
- scoped_ptr<DownloadItemModel> download_model_;
+ DownloadItemModel download_model_;
// The dangerous download dialog. This will be null for safe downloads.
GtkWidget* dangerous_prompt_;
« no previous file with comments | « chrome/browser/ui/cocoa/download/download_shelf_mac.mm ('k') | chrome/browser/ui/gtk/download/download_item_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698