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

Side by Side Diff: services/ui/ws/platform_display.cc

Issue 2256343003: Update ui::PointerEvent to support mouse wheel and capture change events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 3 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
« no previous file with comments | « services/ui/ws/event_dispatcher_unittest.cc ('k') | ui/events/event.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "services/ui/ws/platform_display.h" 5 #include "services/ui/ws/platform_display.h"
6 6
7 #include "base/numerics/safe_conversions.h" 7 #include "base/numerics/safe_conversions.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "cc/ipc/quads.mojom.h" 9 #include "cc/ipc/quads.mojom.h"
10 #include "cc/output/copy_output_request.h" 10 #include "cc/output/copy_output_request.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 frame_generator_->RequestRedraw(damaged_region); 204 frame_generator_->RequestRedraw(damaged_region);
205 } 205 }
206 206
207 void DefaultPlatformDisplay::DispatchEvent(ui::Event* event) { 207 void DefaultPlatformDisplay::DispatchEvent(ui::Event* event) {
208 if (event->IsLocatedEvent()) 208 if (event->IsLocatedEvent())
209 UpdateEventRootLocation(event->AsLocatedEvent()); 209 UpdateEventRootLocation(event->AsLocatedEvent());
210 210
211 if (event->IsScrollEvent()) { 211 if (event->IsScrollEvent()) {
212 // TODO(moshayedi): crbug.com/602859. Dispatch scroll events as 212 // TODO(moshayedi): crbug.com/602859. Dispatch scroll events as
213 // they are once we have proper support for scroll events. 213 // they are once we have proper support for scroll events.
214 delegate_->OnEvent(ui::MouseWheelEvent(*event->AsScrollEvent())); 214 delegate_->OnEvent(
215 } else if (event->IsMouseEvent() && !event->IsMouseWheelEvent()) { 215 ui::PointerEvent(ui::MouseWheelEvent(*event->AsScrollEvent())));
216 } else if (event->IsMouseEvent()) {
216 delegate_->OnEvent(ui::PointerEvent(*event->AsMouseEvent())); 217 delegate_->OnEvent(ui::PointerEvent(*event->AsMouseEvent()));
217 } else if (event->IsTouchEvent()) { 218 } else if (event->IsTouchEvent()) {
218 delegate_->OnEvent(ui::PointerEvent(*event->AsTouchEvent())); 219 delegate_->OnEvent(ui::PointerEvent(*event->AsTouchEvent()));
219 } else { 220 } else {
220 delegate_->OnEvent(*event); 221 delegate_->OnEvent(*event);
221 } 222 }
222 223
223 #if defined(USE_X11) || defined(USE_OZONE) 224 #if defined(USE_X11) || defined(USE_OZONE)
224 // We want to emulate the WM_CHAR generation behaviour of Windows. 225 // We want to emulate the WM_CHAR generation behaviour of Windows.
225 // 226 //
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 return delegate_ ? delegate_->IsInHighContrastMode() : false; 295 return delegate_ ? delegate_->IsInHighContrastMode() : false;
295 } 296 }
296 297
297 const ViewportMetrics& DefaultPlatformDisplay::GetViewportMetrics() { 298 const ViewportMetrics& DefaultPlatformDisplay::GetViewportMetrics() {
298 return metrics_; 299 return metrics_;
299 } 300 }
300 301
301 } // namespace ws 302 } // namespace ws
302 303
303 } // namespace ui 304 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/event_dispatcher_unittest.cc ('k') | ui/events/event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698