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

Unified Diff: chrome/browser/ui/views/download/download_shelf_context_menu_view.cc

Issue 8757007: Implement additional UI changes for dangerous download warnings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 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
« no previous file with comments | « chrome/browser/ui/views/download/download_shelf_context_menu_view.h ('k') | chrome/common/url_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/download/download_shelf_context_menu_view.cc
diff --git a/chrome/browser/ui/views/download/download_shelf_context_menu_view.cc b/chrome/browser/ui/views/download/download_shelf_context_menu_view.cc
index f9917eb5e6265ba4abe38e338695a34e92c93f70..a6b003a43ce77dfec5476ecd241d6a418489a636 100644
--- a/chrome/browser/ui/views/download/download_shelf_context_menu_view.cc
+++ b/chrome/browser/ui/views/download/download_shelf_context_menu_view.cc
@@ -21,7 +21,7 @@ DownloadShelfContextMenuView::DownloadShelfContextMenuView(
DownloadShelfContextMenuView::~DownloadShelfContextMenuView() {}
-bool DownloadShelfContextMenuView::Run(views::Widget* parent_widget,
+void DownloadShelfContextMenuView::Run(views::Widget* parent_widget,
const gfx::Rect& rect) {
views::MenuModelAdapter menu_model_adapter(GetMenuModel());
menu_runner_.reset(new views::MenuRunner(menu_model_adapter.CreateMenu()));
@@ -32,14 +32,15 @@ bool DownloadShelfContextMenuView::Run(views::Widget* parent_widget,
position = views::MenuItemView::TOPRIGHT;
else
position = views::MenuItemView::TOPLEFT;
- return menu_runner_->RunMenuAt(
+
+ // The return value of RunMenuAt indicates whether the MenuRunner was deleted
+ // while running the menu, which indicates that the containing view may have
+ // been deleted. We ignore the return value because our caller already assumes
+ // that the view could be deleted by the time we return from here.
+ ignore_result(menu_runner_->RunMenuAt(
parent_widget,
NULL,
rect,
position,
- views::MenuRunner::HAS_MNEMONICS) == views::MenuRunner::MENU_DELETED;
-}
-
-void DownloadShelfContextMenuView::Stop() {
- set_download_item(NULL);
+ views::MenuRunner::HAS_MNEMONICS));
}
« no previous file with comments | « chrome/browser/ui/views/download/download_shelf_context_menu_view.h ('k') | chrome/common/url_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698