| OLD | NEW |
| 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/ozone/platform/dri/dri_window.h" | 5 #include "ui/ozone/platform/dri/dri_window.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "ui/events/event.h" | 8 #include "ui/events/event.h" |
| 9 #include "ui/events/ozone/evdev/event_factory_evdev.h" | 9 #include "ui/events/ozone/evdev/event_factory_evdev.h" |
| 10 #include "ui/events/ozone/events_ozone.h" | 10 #include "ui/events/ozone/events_ozone.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 96 |
| 97 bool DriWindow::CanDispatchEvent(const PlatformEvent& ne) { | 97 bool DriWindow::CanDispatchEvent(const PlatformEvent& ne) { |
| 98 DCHECK(ne); | 98 DCHECK(ne); |
| 99 Event* event = static_cast<Event*>(ne); | 99 Event* event = static_cast<Event*>(ne); |
| 100 if (event->IsMouseEvent() || event->IsScrollEvent()) | 100 if (event->IsMouseEvent() || event->IsScrollEvent()) |
| 101 return window_manager_->cursor()->GetCursorWindow() == widget_; | 101 return window_manager_->cursor()->GetCursorWindow() == widget_; |
| 102 | 102 |
| 103 return true; | 103 return true; |
| 104 } | 104 } |
| 105 | 105 |
| 106 uint32_t DriWindow::DispatchEvent(const PlatformEvent& native_event) { | 106 ui::PostDispatchAction DriWindow::DispatchEvent( |
| 107 const PlatformEvent& native_event) { |
| 107 DispatchEventFromNativeUiEvent( | 108 DispatchEventFromNativeUiEvent( |
| 108 native_event, | 109 native_event, |
| 109 base::Bind(&PlatformWindowDelegate::DispatchEvent, | 110 base::Bind(&PlatformWindowDelegate::DispatchEvent, |
| 110 base::Unretained(delegate_))); | 111 base::Unretained(delegate_))); |
| 111 return POST_DISPATCH_STOP_PROPAGATION; | 112 return POST_DISPATCH_STOP_PROPAGATION; |
| 112 } | 113 } |
| 113 | 114 |
| 114 void DriWindow::OnChannelEstablished() { | 115 void DriWindow::OnChannelEstablished() { |
| 115 sender_->Send(new OzoneGpuMsg_CreateWindowDelegate(widget_)); | 116 sender_->Send(new OzoneGpuMsg_CreateWindowDelegate(widget_)); |
| 116 sender_->Send(new OzoneGpuMsg_WindowBoundsChanged(widget_, bounds_)); | 117 sender_->Send(new OzoneGpuMsg_WindowBoundsChanged(widget_, bounds_)); |
| 117 } | 118 } |
| 118 | 119 |
| 119 void DriWindow::OnChannelDestroyed() { | 120 void DriWindow::OnChannelDestroyed() { |
| 120 } | 121 } |
| 121 | 122 |
| 122 } // namespace ui | 123 } // namespace ui |
| OLD | NEW |