| Index: chrome/browser/ui/views/download/download_item_view_md.cc
|
| diff --git a/chrome/browser/ui/views/download/download_item_view_md.cc b/chrome/browser/ui/views/download/download_item_view_md.cc
|
| index 87200361f164b791178b55d132a64166b00e6085..55c4500bb8bbc2770ea613148a706c2496023bc2 100644
|
| --- a/chrome/browser/ui/views/download/download_item_view_md.cc
|
| +++ b/chrome/browser/ui/views/download/download_item_view_md.cc
|
| @@ -827,17 +827,11 @@ void DownloadItemViewMd::ShowContextMenuImpl(const gfx::Rect& rect,
|
| static_cast<views::internal::RootView*>(GetWidget()->GetRootView())
|
| ->SetMouseHandler(NULL);
|
|
|
| - // Post a task to release the button. When we call the Run method on the menu
|
| - // below, it runs an inner message loop that might cause us to be deleted.
|
| - // Posting a task with a WeakPtr lets us safely handle the button release.
|
| - base::ThreadTaskRunnerHandle::Get()->PostNonNestableTask(
|
| - FROM_HERE, base::Bind(&DownloadItemViewMd::ReleaseDropdown,
|
| - weak_ptr_factory_.GetWeakPtr()));
|
| -
|
| if (!context_menu_.get())
|
| context_menu_.reset(new DownloadShelfContextMenuView(download()));
|
| - context_menu_->Run(GetWidget()->GetTopLevelWidget(), rect, source_type);
|
| - // We could be deleted now.
|
| + context_menu_->Run(GetWidget()->GetTopLevelWidget(), rect, source_type,
|
| + base::Bind(&DownloadItemViewMd::ReleaseDropdown,
|
| + weak_ptr_factory_.GetWeakPtr()));
|
| }
|
|
|
| void DownloadItemViewMd::HandlePressEvent(const ui::LocatedEvent& event,
|
|
|