diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-31 13:46:57 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-31 13:46:57 +0000 |
commit | f6b96f5d51352e6f55e723dd15c8793f73a9cee0 (patch) | |
tree | 33e7c05e1f202f1735befffdc43a5254e28fbda5 /ui/views/controls/menu/menu_controller.h | |
parent | ca72f097519271d23f24a6336056ad07c67f192c (diff) | |
download | chromium_src-f6b96f5d51352e6f55e723dd15c8793f73a9cee0.zip chromium_src-f6b96f5d51352e6f55e723dd15c8793f73a9cee0.tar.gz chromium_src-f6b96f5d51352e6f55e723dd15c8793f73a9cee0.tar.bz2 |
views: Some MenuController cleanup.
Notable changes:
* Move code out of menu_controller_aura.cc into menu_controller.cc since it
doesn't make sense to have separate files anymore.
* Move the message-pump dispatching code out of MenuController into a separate
MenuMessagePumpDispatcher object.
BUG=343577
R=sky@chromium.org
Review URL: https://codereview.chromium.org/216423015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260540 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/controls/menu/menu_controller.h')
-rw-r--r-- | ui/views/controls/menu/menu_controller.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/ui/views/controls/menu/menu_controller.h b/ui/views/controls/menu/menu_controller.h index 3425caf3..cab7bae 100644 --- a/ui/views/controls/menu/menu_controller.h +++ b/ui/views/controls/menu/menu_controller.h @@ -13,20 +13,22 @@ #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" -#include "base/message_loop/message_pump_dispatcher.h" #include "base/timer/timer.h" #include "ui/events/event_constants.h" #include "ui/views/controls/menu/menu_delegate.h" #include "ui/views/controls/menu/menu_item_view.h" #include "ui/views/widget/widget_observer.h" -namespace ui { -class NativeTheme; -class OSExchangeData; +namespace base { +class MessagePumpDispatcher; } namespace gfx { class Screen; } +namespace ui { +class NativeTheme; +class OSExchangeData; +} namespace views { class MenuButton; @@ -37,6 +39,7 @@ class View; namespace internal { class MenuControllerDelegate; +class MenuMessagePumpDispatcher; class MenuRunnerImpl; } @@ -45,8 +48,7 @@ class MenuRunnerImpl; // 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 base::MessagePumpDispatcher, - public WidgetObserver { +class VIEWS_EXPORT MenuController : public WidgetObserver { public: // Enumeration of how the menu should exit. enum ExitType { @@ -140,6 +142,7 @@ class VIEWS_EXPORT MenuController : public base::MessagePumpDispatcher, static void TurnOffMenuSelectionHoldForTest(); private: + friend class internal::MenuMessagePumpDispatcher; friend class internal::MenuRunnerImpl; friend class MenuHostRootView; friend class MenuItemView; @@ -251,10 +254,6 @@ class VIEWS_EXPORT MenuController : public base::MessagePumpDispatcher, const ui::LocatedEvent& event); void StartDrag(SubmenuView* source, const gfx::Point& location); - // Dispatcher method. This returns true if the menu was canceled, or - // if the message is such that the menu should be closed. - virtual uint32_t Dispatch(const base::NativeEvent& event) OVERRIDE; - // Key processing. The return value of this is returned from Dispatch. // In other words, if this returns false (which happens if escape was // pressed, or a matching mnemonic was found) the message loop returns. |