diff options
-rw-r--r-- | ui/aura/desktop.cc | 9 | ||||
-rw-r--r-- | ui/aura/desktop.h | 6 | ||||
-rw-r--r-- | views/controls/menu/menu_controller.cc | 7 |
3 files changed, 7 insertions, 15 deletions
diff --git a/ui/aura/desktop.cc b/ui/aura/desktop.cc index 138abb3..79e25c0 100644 --- a/ui/aura/desktop.cc +++ b/ui/aura/desktop.cc @@ -138,15 +138,6 @@ void Desktop::WindowDestroying(Window* window) { SetActiveWindow(GetTopmostWindowToActivate(window), NULL); } -bool Desktop::DispatchNativeEvent(const base::NativeEvent& event) { - // TODO(oshima): consolidate windows and linux. -#if defined(OS_WIN) - return host_->Dispatch(event); -#else - return host_->Dispatch(event) != base::MessagePumpDispatcher::EVENT_IGNORED; -#endif -} - MessageLoop::Dispatcher* Desktop::GetDispatcher() { return host_.get(); } diff --git a/ui/aura/desktop.h b/ui/aura/desktop.h index ad8db20..ab6e7f2 100644 --- a/ui/aura/desktop.h +++ b/ui/aura/desktop.h @@ -95,13 +95,11 @@ class AURA_EXPORT Desktop : public ui::CompositorDelegate { void WindowDestroying(Window* window); // Returns the desktop's dispatcher. The result should only be passed to - // MessageLoopForUI::Run() or MessageLoopForUI::RunAllPendingWithDispatcher(). + // MessageLoopForUI::Run() or MessageLoopForUI::RunAllPendingWithDispatcher(), + // or used to dispatch an event by |Dispatch(const NativeEvent&)| on it. // It must never be stored. MessageLoop::Dispatcher* GetDispatcher(); - // Dispatch NativeEvent. - bool DispatchNativeEvent(const base::NativeEvent& event); - static Desktop* GetInstance(); private: diff --git a/views/controls/menu/menu_controller.cc b/views/controls/menu/menu_controller.cc index c215b70..a4b0d56 100644 --- a/views/controls/menu/menu_controller.cc +++ b/views/controls/menu/menu_controller.cc @@ -889,7 +889,7 @@ base::MessagePumpDispatcher::DispatchStatus base::MessagePumpDispatcher::DispatchStatus MenuController::Dispatch(XEvent* xev) { if (exit_type_ == EXIT_ALL || exit_type_ == EXIT_DESTROYED) { - aura::Desktop::GetInstance()->DispatchNativeEvent(xev); + aura::Desktop::GetInstance()->GetDispatcher()->Dispatch(xev); return base::MessagePumpDispatcher::EVENT_QUIT; } switch (ui::EventTypeFromNative(xev)) { @@ -907,7 +907,10 @@ base::MessagePumpDispatcher::DispatchStatus break; } - if (!aura::Desktop::GetInstance()->DispatchNativeEvent(xev)) + // TODO(oshima): Update Windows' Dispatcher to return DispatchStatus + // instead of bool. + if (aura::Desktop::GetInstance()->GetDispatcher()->Dispatch(xev) == + base::MessagePumpDispatcher::EVENT_IGNORED) return EVENT_IGNORED; return exit_type_ != EXIT_NONE ? base::MessagePumpDispatcher::EVENT_QUIT : |