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

Unified Diff: ui/views/controls/menu/menu_controller.h

Issue 2659903002: Change MenuControllerDelegate to provide WeakPtr (Closed)
Patch Set: Created 3 years, 11 months 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 | « no previous file | ui/views/controls/menu/menu_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_controller.h
diff --git a/ui/views/controls/menu/menu_controller.h b/ui/views/controls/menu/menu_controller.h
index 697e9a5781f25efd1c917c02607a39967087a4fd..1c5fb326d08acc69c1efdb356e25e65a7aa2cb6e 100644
--- a/ui/views/controls/menu/menu_controller.h
+++ b/ui/views/controls/menu/menu_controller.h
@@ -606,7 +606,8 @@ class VIEWS_EXPORT MenuController
// When Run is invoked during an active Run, it may be called from a separate
// MenuControllerDelegate. If not empty is means we are nested, and the
// stacked delegates should be notified instead of |delegate_|.
- typedef std::pair<internal::MenuControllerDelegate*, bool> NestedDelegate;
+ typedef std::pair<base::WeakPtr<internal::MenuControllerDelegate>, bool>
+ NestedDelegate;
std::list<NestedDelegate> delegate_stack_;
// As the mouse moves around submenus are not opened immediately. Instead
@@ -664,7 +665,7 @@ class VIEWS_EXPORT MenuController
// Current hot tracked child button if any.
CustomButton* hot_button_;
- internal::MenuControllerDelegate* delegate_;
+ base::WeakPtr<internal::MenuControllerDelegate> delegate_;
// How deep we are in nested message loops. This should be at most 2 (when
// showing a context menu from a menu).
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698