| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_ozone.h" | 5 #include "ui/platform_window/x11/x11_window_ozone.h" |
| 6 | 6 |
| 7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
| 11 #include "ui/events/ozone/events_ozone.h" | 11 #include "ui/events/ozone/events_ozone.h" |
| 12 #include "ui/events/platform/x11/x11_event_source.h" | 12 #include "ui/events/platform/x11/x11_event_source.h" |
| 13 #include "ui/gfx/geometry/point.h" | 13 #include "ui/gfx/geometry/point.h" |
| 14 #include "ui/platform_window/x11/x11_cursor_ozone.h" | 14 #include "ui/platform_window/x11/x11_cursor_ozone.h" |
| 15 #include "ui/platform_window/x11/x11_window_manager_ozone.h" | 15 #include "ui/platform_window/x11/x11_window_manager_ozone.h" |
| 16 | 16 |
| 17 namespace ui { | 17 namespace ui { |
| 18 | 18 |
| 19 X11WindowOzone::X11WindowOzone(X11EventSourceLibevent* event_source, | 19 X11WindowOzone::X11WindowOzone(X11EventSourceLibevent* event_source, |
| 20 X11WindowManagerOzone* window_manager, | 20 X11WindowManagerOzone* window_manager, |
| 21 PlatformWindowDelegate* delegate) | 21 PlatformWindowDelegate* delegate, |
| 22 : X11WindowBase(delegate), | 22 const gfx::Rect& bounds) |
| 23 : X11WindowBase(delegate, bounds), |
| 23 event_source_(event_source), | 24 event_source_(event_source), |
| 24 window_manager_(window_manager) { | 25 window_manager_(window_manager) { |
| 25 DCHECK(event_source_); | 26 DCHECK(event_source_); |
| 26 DCHECK(window_manager); | 27 DCHECK(window_manager); |
| 27 event_source_->AddPlatformEventDispatcher(this); | 28 event_source_->AddPlatformEventDispatcher(this); |
| 28 event_source_->AddXEventDispatcher(this); | 29 event_source_->AddXEventDispatcher(this); |
| 29 } | 30 } |
| 30 | 31 |
| 31 X11WindowOzone::~X11WindowOzone() { | 32 X11WindowOzone::~X11WindowOzone() { |
| 32 event_source_->RemovePlatformEventDispatcher(this); | 33 event_source_->RemovePlatformEventDispatcher(this); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 uint32_t X11WindowOzone::DispatchEvent(const PlatformEvent& platform_event) { | 78 uint32_t X11WindowOzone::DispatchEvent(const PlatformEvent& platform_event) { |
| 78 // This is unfortunately needed otherwise events that depend on global state | 79 // This is unfortunately needed otherwise events that depend on global state |
| 79 // (eg. double click) are broken. | 80 // (eg. double click) are broken. |
| 80 DispatchEventFromNativeUiEvent( | 81 DispatchEventFromNativeUiEvent( |
| 81 platform_event, base::Bind(&PlatformWindowDelegate::DispatchEvent, | 82 platform_event, base::Bind(&PlatformWindowDelegate::DispatchEvent, |
| 82 base::Unretained(delegate()))); | 83 base::Unretained(delegate()))); |
| 83 return POST_DISPATCH_STOP_PROPAGATION; | 84 return POST_DISPATCH_STOP_PROPAGATION; |
| 84 } | 85 } |
| 85 | 86 |
| 86 } // namespace ui | 87 } // namespace ui |
| OLD | NEW |