diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-09 19:50:06 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-09 19:50:06 +0000 |
commit | 046460d54e5397286cba1b3ce9462b4129b2aaab (patch) | |
tree | 79b0e31f0a28b01ae9b1dfd12dad5be6fa3368b4 /ash/accelerators/nested_dispatcher_controller_unittest.cc | |
parent | c90ec6552b57ec596c35a4c44082ad518857a393 (diff) | |
download | chromium_src-046460d54e5397286cba1b3ce9462b4129b2aaab.zip chromium_src-046460d54e5397286cba1b3ce9462b4129b2aaab.tar.gz chromium_src-046460d54e5397286cba1b3ce9462b4129b2aaab.tar.bz2 |
Consolidate win/x dispatchers
BUG=116282
TEST=no functional change. All tests should pass.
Review URL: http://codereview.chromium.org/9958152
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131412 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/accelerators/nested_dispatcher_controller_unittest.cc')
-rw-r--r-- | ash/accelerators/nested_dispatcher_controller_unittest.cc | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/ash/accelerators/nested_dispatcher_controller_unittest.cc b/ash/accelerators/nested_dispatcher_controller_unittest.cc index 905b353..18c24e0 100644 --- a/ash/accelerators/nested_dispatcher_controller_unittest.cc +++ b/ash/accelerators/nested_dispatcher_controller_unittest.cc @@ -15,6 +15,7 @@ #include "ui/aura/test/test_windows.h" #include "ui/aura/window.h" #include "ui/base/accelerators/accelerator.h" +#include "ui/base/events.h" #if defined(USE_X11) #include <X11/Xlib.h> @@ -33,21 +34,13 @@ class MockDispatcher : public MessageLoop::Dispatcher { int num_key_events_dispatched() { return num_key_events_dispatched_; } -#if defined(OS_WIN) - virtual bool Dispatch(const MSG& msg) OVERRIDE { - if (msg.message == WM_KEYUP) +#if defined(OS_WIN) || defined(USE_X11) + virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE { + if (ui::EventTypeFromNative(event) == ui::ET_KEY_RELEASED) num_key_events_dispatched_++; - return !ui::IsNoopEvent(msg); + return !ui::IsNoopEvent(event); } -#elif defined(USE_X11) - virtual base::MessagePumpDispatcher::DispatchStatus Dispatch( - XEvent* xev) OVERRIDE { - if (xev->type == KeyRelease) - num_key_events_dispatched_++; - return ui::IsNoopEvent(xev) ? MessagePumpDispatcher::EVENT_QUIT : - MessagePumpDispatcher::EVENT_IGNORED; - } -#endif +#endif // defined(OS_WIN) || defined(USE_X11) private: int num_key_events_dispatched_; |