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

Unified Diff: components/exo/pointer.cc

Issue 2458853002: exo: Replace fling cancel with generic zero distance scroll
Patch Set: fixed nits Created 4 years, 1 month 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 | « components/exo/pointer.h ('k') | components/exo/pointer_delegate.h » ('j') | no next file with comments »
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 46fbcb109b8397317b0599b9f6c6e5d28149da82..e83dbcd48d315fc25046eda23e521cde46d2e492 100644
--- a/components/exo/pointer.cc
+++ b/components/exo/pointer.cc
@@ -247,8 +247,11 @@ void Pointer::OnMouseEvent(ui::MouseEvent* event) {
}
break;
case ui::ET_SCROLL_FLING_CANCEL:
- if (focus_) {
- delegate_->OnPointerScrollCancel(event->time_stamp());
+ if (focus_ && last_event_type_ == ui::ET_SCROLL_FLING_START) {
+ delegate_->OnPointerScroll(event->time_stamp(), gfx::Vector2dF(),
+ false);
+ delegate_->OnPointerFrame();
+ delegate_->OnPointerScrollStop(event->time_stamp());
delegate_->OnPointerFrame();
}
break;
@@ -263,8 +266,10 @@ void Pointer::OnMouseEvent(ui::MouseEvent* event) {
break;
}
- if ((event->flags() & ui::EF_IS_SYNTHESIZED) == 0)
- is_direct_input_ = (event->flags() & ui::EF_DIRECT_INPUT) != 0;
+ if (!(event->flags() & ui::EF_IS_SYNTHESIZED)) {
+ is_direct_input_ = event->flags() & ui::EF_DIRECT_INPUT;
+ last_event_type_ = event->type();
+ }
// Update cursor widget to reflect current focus and pointer location.
if (focus_ && !is_direct_input_) {
« no previous file with comments | « components/exo/pointer.h ('k') | components/exo/pointer_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698