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

Side by Side Diff: ui/platform_window/x11/x11_window.cc

Issue 667823002: PlatformEventDispatcher::DispatchEvent() should return a PostDispatchAction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ui_enums
Patch Set: Fix platform_event_source_unittest.cc Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/platform_window/x11/x11_window.h" 5 #include "ui/platform_window/x11/x11_window.h"
6 6
7 #include <X11/extensions/XInput2.h> 7 #include <X11/extensions/XInput2.h>
8 #include <X11/Xatom.h> 8 #include <X11/Xatom.h>
9 #include <X11/Xlib.h> 9 #include <X11/Xlib.h>
10 #include <X11/Xutil.h> 10 #include <X11/Xutil.h>
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 void X11Window::Restore() {} 247 void X11Window::Restore() {}
248 248
249 void X11Window::SetCursor(PlatformCursor cursor) {} 249 void X11Window::SetCursor(PlatformCursor cursor) {}
250 250
251 void X11Window::MoveCursorTo(const gfx::Point& location) {} 251 void X11Window::MoveCursorTo(const gfx::Point& location) {}
252 252
253 bool X11Window::CanDispatchEvent(const PlatformEvent& event) { 253 bool X11Window::CanDispatchEvent(const PlatformEvent& event) {
254 return FindXEventTarget(event) == xwindow_; 254 return FindXEventTarget(event) == xwindow_;
255 } 255 }
256 256
257 uint32_t X11Window::DispatchEvent(const PlatformEvent& event) { 257 ui::PostDispatchAction X11Window::DispatchEvent(const PlatformEvent& event) {
258 XEvent* xev = event; 258 XEvent* xev = event;
259 switch (xev->type) { 259 switch (xev->type) {
260 case EnterNotify: { 260 case EnterNotify: {
261 // EnterNotify creates ET_MOUSE_MOVED. Mark as synthesized as this is 261 // EnterNotify creates ET_MOUSE_MOVED. Mark as synthesized as this is
262 // not real mouse move event. 262 // not real mouse move event.
263 MouseEvent mouse_event(xev); 263 MouseEvent mouse_event(xev);
264 CHECK_EQ(ET_MOUSE_MOVED, mouse_event.type()); 264 CHECK_EQ(ET_MOUSE_MOVED, mouse_event.type());
265 mouse_event.set_flags(mouse_event.flags() | EF_IS_SYNTHESIZED); 265 mouse_event.set_flags(mouse_event.flags() | EF_IS_SYNTHESIZED);
266 delegate_->DispatchEvent(&mouse_event); 266 delegate_->DispatchEvent(&mouse_event);
267 break; 267 break;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 351
352 case GenericEvent: { 352 case GenericEvent: {
353 ProcessXInput2Event(xev); 353 ProcessXInput2Event(xev);
354 break; 354 break;
355 } 355 }
356 } 356 }
357 return POST_DISPATCH_STOP_PROPAGATION; 357 return POST_DISPATCH_STOP_PROPAGATION;
358 } 358 }
359 359
360 } // namespace ui 360 } // namespace ui
OLDNEW
« no previous file with comments | « ui/platform_window/x11/x11_window.h ('k') | ui/views/controls/menu/menu_event_dispatcher_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698