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

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

Issue 2654093005: Fix MenuRunner Releasing (Closed)
Patch Set: Clarification and renaming 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 30b988954f6a353ce461b1b162539c00d0690f5f..697e9a5781f25efd1c917c02607a39967087a4fd 100644
--- a/ui/views/controls/menu/menu_controller.h
+++ b/ui/views/controls/menu/menu_controller.h
@@ -14,6 +14,7 @@
#include "base/compiler_specific.h"
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "base/timer/timer.h"
#include "build/build_config.h"
#include "ui/events/event.h"
@@ -56,7 +57,9 @@ class MenuControllerTestApi;
// MenuController is used internally by the various menu classes to manage
// showing, selecting and drag/drop for menus. All relevant events are
// forwarded to the MenuController from SubmenuView and MenuHost.
-class VIEWS_EXPORT MenuController : public WidgetObserver {
+class VIEWS_EXPORT MenuController
+ : public base::SupportsWeakPtr<MenuController>,
+ public WidgetObserver {
public:
// Enumeration of how the menu should exit.
enum ExitType {
@@ -186,6 +189,10 @@ class VIEWS_EXPORT MenuController : public WidgetObserver {
// Only used for testing.
bool IsCancelAllTimerRunningForTest();
+ // Only used for testing. Clears |state_| and |pending_state_| without
+ // notifying any menu items.
+ void ClearStateForTest();
+
// Only used for testing.
static void TurnOffMenuSelectionHoldForTest();
« 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