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

Unified Diff: ash/accelerators/nested_dispatcher_controller_unittest.cc

Issue 9958152: Consolidate win/x dispatchers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync, addressed comments Created 8 years, 8 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 | « ash/accelerators/accelerator_dispatcher_win.cc ('k') | ash/ash.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/nested_dispatcher_controller_unittest.cc
diff --git a/ash/accelerators/nested_dispatcher_controller_unittest.cc b/ash/accelerators/nested_dispatcher_controller_unittest.cc
index 905b35391a01e5cbcb3549fabe43fff4818ec598..18c24e0bcbf88c7166108ec32f18510c748439cd 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_;
« no previous file with comments | « ash/accelerators/accelerator_dispatcher_win.cc ('k') | ash/ash.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698