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/base_event_utils.h" | |
8 #include "ui/events/devices/device_data_manager.h" | 9 #include "ui/events/devices/device_data_manager.h" |
9 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
10 #include "ui/events/ozone/evdev/event_factory_evdev.h" | 11 #include "ui/events/ozone/evdev/event_factory_evdev.h" |
11 #include "ui/events/ozone/events_ozone.h" | 12 #include "ui/events/ozone/events_ozone.h" |
12 #include "ui/events/platform/platform_event_source.h" | 13 #include "ui/events/platform/platform_event_source.h" |
13 #include "ui/gfx/display.h" | 14 #include "ui/gfx/display.h" |
14 #include "ui/ozone/common/gpu/ozone_gpu_messages.h" | 15 #include "ui/ozone/common/gpu/ozone_gpu_messages.h" |
15 #include "ui/ozone/platform/drm/host/drm_cursor.h" | 16 #include "ui/ozone/platform/drm/host/drm_cursor.h" |
16 #include "ui/ozone/platform/drm/host/drm_display_host.h" | 17 #include "ui/ozone/platform/drm/host/drm_display_host.h" |
17 #include "ui/ozone/platform/drm/host/drm_display_host_manager.h" | 18 #include "ui/ozone/platform/drm/host/drm_display_host_manager.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
131 bool DrmWindowHost::CanDispatchEvent(const PlatformEvent& ne) { | 132 bool DrmWindowHost::CanDispatchEvent(const PlatformEvent& ne) { |
132 DCHECK(ne); | 133 DCHECK(ne); |
133 Event* event = static_cast<Event*>(ne); | 134 Event* event = static_cast<Event*>(ne); |
134 | 135 |
135 // If there is a grab, capture events here. | 136 // If there is a grab, capture events here. |
136 gfx::AcceleratedWidget grabber = window_manager_->event_grabber(); | 137 gfx::AcceleratedWidget grabber = window_manager_->event_grabber(); |
137 if (grabber != gfx::kNullAcceleratedWidget) | 138 if (grabber != gfx::kNullAcceleratedWidget) |
138 return grabber == widget_; | 139 return grabber == widget_; |
139 | 140 |
140 if (event->IsTouchEvent()) { | 141 if (event->IsTouchEvent()) { |
142 if (!ui::AreTouchEventsEnabled()) | |
spang
2015/11/03 22:11:45
If you must do this, this isn't the right place.
afakhry
2015/11/04 02:28:21
ui/base/touch has been removed from DEPS since it'
| |
143 return false; | |
144 | |
141 // Dispatch the event if it is from the touchscreen associated with the | 145 // Dispatch the event if it is from the touchscreen associated with the |
142 // DrmWindowHost. We cannot check the event's location because if the | 146 // DrmWindowHost. We cannot check the event's location because if the |
143 // touchscreen has a bezel, touches in the bezel have a location outside of | 147 // touchscreen has a bezel, touches in the bezel have a location outside of |
144 // |bounds_|. | 148 // |bounds_|. |
145 int64_t display_id = | 149 int64_t display_id = |
146 DeviceDataManager::GetInstance()->GetTargetDisplayForTouchDevice( | 150 DeviceDataManager::GetInstance()->GetTargetDisplayForTouchDevice( |
147 event->source_device_id()); | 151 event->source_device_id()); |
148 | 152 |
149 if (display_id == gfx::Display::kInvalidDisplayID) | 153 if (display_id == gfx::Display::kInvalidDisplayID) |
150 return false; | 154 return false; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
203 // Update the cursor before the window so that the cursor stays within the | 207 // Update the cursor before the window so that the cursor stays within the |
204 // window bounds when the window size shrinks. | 208 // window bounds when the window size shrinks. |
205 cursor_->CommitBoundsChange(widget_, bounds_, GetCursorConfinedBounds()); | 209 cursor_->CommitBoundsChange(widget_, bounds_, GetCursorConfinedBounds()); |
206 sender_->Send(new OzoneGpuMsg_WindowBoundsChanged(widget_, bounds_)); | 210 sender_->Send(new OzoneGpuMsg_WindowBoundsChanged(widget_, bounds_)); |
207 | 211 |
208 if (overlay_candidates_host_) | 212 if (overlay_candidates_host_) |
209 overlay_candidates_host_->ResetCache(); | 213 overlay_candidates_host_->ResetCache(); |
210 } | 214 } |
211 | 215 |
212 } // namespace ui | 216 } // namespace ui |
OLD | NEW |