| 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/drm/host/drm_window_host.h" | 5 #include "ui/ozone/platform/drm/host/drm_window_host.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "ui/events/devices/device_data_manager.h" | 8 #include "ui/events/devices/device_data_manager.h" |
| 9 #include "ui/events/event.h" | 9 #include "ui/events/event.h" |
| 10 #include "ui/events/ozone/evdev/event_factory_evdev.h" | 10 #include "ui/events/ozone/evdev/event_factory_evdev.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 gfx::AcceleratedWidget grabber = window_manager_->event_grabber(); | 126 gfx::AcceleratedWidget grabber = window_manager_->event_grabber(); |
| 127 if (grabber != gfx::kNullAcceleratedWidget) | 127 if (grabber != gfx::kNullAcceleratedWidget) |
| 128 return grabber == widget_; | 128 return grabber == widget_; |
| 129 | 129 |
| 130 if (event->IsTouchEvent()) { | 130 if (event->IsTouchEvent()) { |
| 131 // Dispatch the event if it is from the touchscreen associated with the | 131 // Dispatch the event if it is from the touchscreen associated with the |
| 132 // DrmWindowHost. We cannot check the event's location because if the | 132 // DrmWindowHost. We cannot check the event's location because if the |
| 133 // touchscreen has a bezel, touches in the bezel have a location outside of | 133 // touchscreen has a bezel, touches in the bezel have a location outside of |
| 134 // |bounds_|. | 134 // |bounds_|. |
| 135 int64_t display_id = | 135 int64_t display_id = |
| 136 DeviceDataManager::GetInstance()->GetDisplayForTouchDevice( | 136 DeviceDataManager::GetInstance()->GetTargetDisplayForTouchDevice( |
| 137 event->source_device_id()); | 137 event->source_device_id()); |
| 138 | 138 |
| 139 if (display_id == gfx::Display::kInvalidDisplayID) | 139 if (display_id == gfx::Display::kInvalidDisplayID) |
| 140 return false; | 140 return false; |
| 141 | 141 |
| 142 DisplaySnapshot* snapshot = display_manager_->GetDisplay(display_id); | 142 DisplaySnapshot* snapshot = display_manager_->GetDisplay(display_id); |
| 143 if (!snapshot || !snapshot->current_mode()) | 143 if (!snapshot || !snapshot->current_mode()) |
| 144 return false; | 144 return false; |
| 145 | 145 |
| 146 gfx::Rect display_bounds(snapshot->origin(), | 146 gfx::Rect display_bounds(snapshot->origin(), |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 void DrmWindowHost::OnChannelDestroyed() { | 182 void DrmWindowHost::OnChannelDestroyed() { |
| 183 } | 183 } |
| 184 | 184 |
| 185 void DrmWindowHost::SendBoundsChange() { | 185 void DrmWindowHost::SendBoundsChange() { |
| 186 cursor_->PrepareForBoundsChange(widget_); | 186 cursor_->PrepareForBoundsChange(widget_); |
| 187 sender_->Send(new OzoneGpuMsg_WindowBoundsChanged(widget_, bounds_)); | 187 sender_->Send(new OzoneGpuMsg_WindowBoundsChanged(widget_, bounds_)); |
| 188 cursor_->CommitBoundsChange(widget_, bounds_, GetCursorConfinedBounds()); | 188 cursor_->CommitBoundsChange(widget_, bounds_, GetCursorConfinedBounds()); |
| 189 } | 189 } |
| 190 | 190 |
| 191 } // namespace ui | 191 } // namespace ui |
| OLD | NEW |