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

Side by Side Diff: components/mus/ws/platform_display.cc

Issue 1892883002: Dispatch scroll events as mouse wheel events in mus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | no next file » | 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 "components/mus/ws/platform_display.h" 5 #include "components/mus/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/output/compositor_frame.h" 9 #include "cc/output/compositor_frame.h"
10 #include "cc/output/copy_output_request.h" 10 #include "cc/output/copy_output_request.h"
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 void DefaultPlatformDisplay::OnBoundsChanged(const gfx::Rect& new_bounds) { 351 void DefaultPlatformDisplay::OnBoundsChanged(const gfx::Rect& new_bounds) {
352 UpdateMetrics(new_bounds.size(), metrics_.device_pixel_ratio); 352 UpdateMetrics(new_bounds.size(), metrics_.device_pixel_ratio);
353 } 353 }
354 354
355 void DefaultPlatformDisplay::OnDamageRect(const gfx::Rect& damaged_region) { 355 void DefaultPlatformDisplay::OnDamageRect(const gfx::Rect& damaged_region) {
356 dirty_rect_.Union(damaged_region); 356 dirty_rect_.Union(damaged_region);
357 WantToDraw(); 357 WantToDraw();
358 } 358 }
359 359
360 void DefaultPlatformDisplay::DispatchEvent(ui::Event* event) { 360 void DefaultPlatformDisplay::DispatchEvent(ui::Event* event) {
361 if (event->IsMouseEvent() && !event->IsMouseWheelEvent()) { 361 if (event->IsScrollEvent()) {
362 // TODO(moshayedi): crbug.com/602859. Dispatch scroll events as
363 // they are once we have proper support for scroll events.
364 delegate_->OnEvent(ui::MouseWheelEvent(*event->AsScrollEvent()));
365 } else if (event->IsMouseEvent() && !event->IsMouseWheelEvent()) {
362 delegate_->OnEvent(ui::PointerEvent(*event->AsMouseEvent())); 366 delegate_->OnEvent(ui::PointerEvent(*event->AsMouseEvent()));
363 } else if (event->IsTouchEvent()) { 367 } else if (event->IsTouchEvent()) {
364 delegate_->OnEvent(ui::PointerEvent(*event->AsTouchEvent())); 368 delegate_->OnEvent(ui::PointerEvent(*event->AsTouchEvent()));
365 } else { 369 } else {
366 delegate_->OnEvent(*event); 370 delegate_->OnEvent(*event);
367 } 371 }
368 372
369 #if defined(USE_X11) || defined(USE_OZONE) 373 #if defined(USE_X11) || defined(USE_OZONE)
370 // We want to emulate the WM_CHAR generation behaviour of Windows. 374 // We want to emulate the WM_CHAR generation behaviour of Windows.
371 // 375 //
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 431
428 void DefaultPlatformDisplay::RequestCopyOfOutput( 432 void DefaultPlatformDisplay::RequestCopyOfOutput(
429 scoped_ptr<cc::CopyOutputRequest> output_request) { 433 scoped_ptr<cc::CopyOutputRequest> output_request) {
430 if (top_level_display_client_) 434 if (top_level_display_client_)
431 top_level_display_client_->RequestCopyOfOutput(std::move(output_request)); 435 top_level_display_client_->RequestCopyOfOutput(std::move(output_request));
432 } 436 }
433 437
434 } // namespace ws 438 } // namespace ws
435 439
436 } // namespace mus 440 } // namespace mus
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698