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

Unified Diff: chrome/browser/ui/gtk/download/download_shelf_context_menu_gtk.cc

Issue 11673004: No need to pass DownloadItemModel ownership. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/gtk/download/download_shelf_context_menu_gtk.cc
diff --git a/chrome/browser/ui/gtk/download/download_shelf_context_menu_gtk.cc b/chrome/browser/ui/gtk/download/download_shelf_context_menu_gtk.cc
index 1441a937ab800973c24df34dfcff4c22888ee490..43b45efc0b46738dda2c895f4a95d70f5abc982e 100644
--- a/chrome/browser/ui/gtk/download/download_shelf_context_menu_gtk.cc
+++ b/chrome/browser/ui/gtk/download/download_shelf_context_menu_gtk.cc
@@ -11,10 +11,9 @@
#include "ui/gfx/point.h"
DownloadShelfContextMenuGtk::DownloadShelfContextMenuGtk(
- DownloadItemModel* model,
DownloadItemGtk* download_item,
content::PageNavigator* navigator)
- : DownloadShelfContextMenu(model, navigator),
+ : DownloadShelfContextMenu(download_item->download(), navigator),
download_item_gtk_(download_item) {
}
@@ -22,7 +21,13 @@ DownloadShelfContextMenuGtk::~DownloadShelfContextMenuGtk() {}
void DownloadShelfContextMenuGtk::Popup(GtkWidget* widget,
GdkEventButton* event) {
- menu_.reset(new MenuGtk(this, GetMenuModel()));
+ ui::SimpleMenuModel* menu_model = GetMenuModel();
+ if (!menu_model) {
+ StoppedShowing();
+ return;
+ }
+
+ menu_.reset(new MenuGtk(this, menu_model));
if (widget)
menu_->PopupForWidget(widget, event->button, event->time);

Powered by Google App Engine
This is Rietveld 408576698