| 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..75da2df85707828083c7ee420028d16b13f74d67 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,11 @@ DownloadShelfContextMenuGtk::~DownloadShelfContextMenuGtk() {}
|
|
|
| void DownloadShelfContextMenuGtk::Popup(GtkWidget* widget,
|
| GdkEventButton* event) {
|
| - menu_.reset(new MenuGtk(this, GetMenuModel()));
|
| + ui::SimpleMenuModel* menu_model = GetMenuModel();
|
| + // Popup() should never be called after the DownloadItem is destroyed.
|
| + DCHECK(menu_model);
|
| +
|
| + menu_.reset(new MenuGtk(this, menu_model));
|
|
|
| if (widget)
|
| menu_->PopupForWidget(widget, event->button, event->time);
|
|
|