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

Unified Diff: components/exo/pointer.cc

Issue 1750633002: components/exo: Extend pointer to use v5 protocol (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit tests Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/exo/pointer_delegate.h » ('j') | components/exo/pointer_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/pointer.cc
diff --git a/components/exo/pointer.cc b/components/exo/pointer.cc
index 345a11806893593613556c1d73eae6956e30cfc1..a4df040b0fa4b1d0005e46ddf58fb87b9425dcd3 100644
--- a/components/exo/pointer.cc
+++ b/components/exo/pointer.cc
@@ -117,29 +117,46 @@ void Pointer::OnMouseEvent(ui::MouseEvent* event) {
case ui::ET_SCROLL:
if (focus_) {
ui::ScrollEvent* scroll_event = static_cast<ui::ScrollEvent*>(event);
- delegate_->OnPointerWheel(
+ delegate_->OnPointerScroll(
event->time_stamp(),
- gfx::Vector2d(scroll_event->x_offset(), scroll_event->y_offset()));
+ gfx::Vector2dF(scroll_event->x_offset(), scroll_event->y_offset()),
+ false);
}
break;
case ui::ET_MOUSEWHEEL:
if (focus_) {
- delegate_->OnPointerWheel(
+ delegate_->OnPointerScroll(
event->time_stamp(),
- static_cast<ui::MouseWheelEvent*>(event)->offset());
+ static_cast<ui::MouseWheelEvent*>(event)->offset(), true);
+ }
+ break;
+ case ui::ET_SCROLL_FLING_START:
+ if (focus_) {
reveman 2016/03/02 04:16:53 nit: not need for "{" "}"
denniskempin 2016/03/02 20:47:58 Done.
+ delegate_->OnPointerScrollStop(event->time_stamp());
+ }
+ break;
+ case ui::ET_SCROLL_FLING_CANCEL:
+ if (focus_) {
+ // Wayland doesn't know the concept of a fling cancel. But we can send a
reveman 2016/03/02 04:16:52 nit: please add a OnPointerScrollStart (feel free
denniskempin 2016/03/02 20:47:58 Done.
+ // zero distance scroll to stop any kinetic scrolling that might be
+ // going on.
+ delegate_->OnPointerScroll(event->time_stamp(), gfx::Vector2dF(0, 0),
+ false);
}
break;
case ui::ET_MOUSE_ENTERED:
case ui::ET_MOUSE_EXITED:
case ui::ET_MOUSE_CAPTURE_CHANGED:
- case ui::ET_SCROLL_FLING_START:
- case ui::ET_SCROLL_FLING_CANCEL:
break;
default:
NOTREACHED();
break;
}
+ if (focus_) {
reveman 2016/03/02 04:16:52 nit: not need for "{" "}"
denniskempin 2016/03/02 20:47:58 Done.
+ delegate_->OnPointerFrame();
+ }
+
// Update cursor widget to reflect current focus and pointer location.
if (focus_) {
if (!widget_)
« no previous file with comments | « no previous file | components/exo/pointer_delegate.h » ('j') | components/exo/pointer_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698