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); |