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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2918053002: Move middle-click autoscroll to synthetic fling. (Closed)
Patch Set: Delete redundant cursor shape print Created 3 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 bool event_cancelled = false; // for disambiguation 675 bool event_cancelled = false; // for disambiguation
676 676
677 // Special handling for slow-path fling gestures. 677 // Special handling for slow-path fling gestures.
678 switch (event.GetType()) { 678 switch (event.GetType()) {
679 case WebInputEvent::kGestureFlingStart: { 679 case WebInputEvent::kGestureFlingStart: {
680 if (MainFrameImpl() 680 if (MainFrameImpl()
681 ->GetFrame() 681 ->GetFrame()
682 ->GetEventHandler() 682 ->GetEventHandler()
683 .IsScrollbarHandlingGestures()) 683 .IsScrollbarHandlingGestures())
684 break; 684 break;
685 EndActiveFlingAnimation(); 685 if (event.source_device != kWebGestureDeviceSyntheticAutoscroll)
686 EndActiveFlingAnimation();
686 position_on_fling_start_ = WebPoint(event.x, event.y); 687 position_on_fling_start_ = WebPoint(event.x, event.y);
687 global_position_on_fling_start_ = 688 global_position_on_fling_start_ =
688 WebPoint(event.global_x, event.global_y); 689 WebPoint(event.global_x, event.global_y);
689 fling_modifier_ = event.GetModifiers(); 690 fling_modifier_ = event.GetModifiers();
690 fling_source_device_ = event.source_device; 691 fling_source_device_ = event.source_device;
691 DCHECK_NE(fling_source_device_, kWebGestureDeviceUninitialized); 692 DCHECK_NE(fling_source_device_, kWebGestureDeviceUninitialized);
692 std::unique_ptr<WebGestureCurve> fling_curve = 693 std::unique_ptr<WebGestureCurve> fling_curve =
693 Platform::Current()->CreateFlingAnimationCurve( 694 Platform::Current()->CreateFlingAnimationCurve(
694 event.source_device, 695 event.source_device,
695 WebFloatPoint(event.data.fling_start.velocity_x, 696 WebFloatPoint(event.data.fling_start.velocity_x,
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1976 1977
1977 // Create synthetic wheel events as necessary for fling. 1978 // Create synthetic wheel events as necessary for fling.
1978 if (gesture_animation_) { 1979 if (gesture_animation_) {
1979 if (gesture_animation_->Animate(last_frame_time_monotonic)) 1980 if (gesture_animation_->Animate(last_frame_time_monotonic))
1980 MainFrameImpl()->FrameWidget()->ScheduleAnimation(); 1981 MainFrameImpl()->FrameWidget()->ScheduleAnimation();
1981 else { 1982 else {
1982 DCHECK_NE(fling_source_device_, kWebGestureDeviceUninitialized); 1983 DCHECK_NE(fling_source_device_, kWebGestureDeviceUninitialized);
1983 WebGestureDevice last_fling_source_device = fling_source_device_; 1984 WebGestureDevice last_fling_source_device = fling_source_device_;
1984 EndActiveFlingAnimation(); 1985 EndActiveFlingAnimation();
1985 1986
1986 WebGestureEvent end_scroll_event = CreateGestureScrollEventFromFling( 1987 if (last_fling_source_device != kWebGestureDeviceSyntheticAutoscroll) {
1987 WebInputEvent::kGestureScrollEnd, last_fling_source_device); 1988 WebGestureEvent end_scroll_event = CreateGestureScrollEventFromFling(
1988 MainFrameImpl()->GetFrame()->GetEventHandler().HandleGestureScrollEnd( 1989 WebInputEvent::kGestureScrollEnd, last_fling_source_device);
1989 end_scroll_event); 1990 MainFrameImpl()->GetFrame()->GetEventHandler().HandleGestureScrollEnd(
1991 end_scroll_event);
1992 }
1990 } 1993 }
1991 } 1994 }
1992 1995
1993 if (!MainFrameImpl()) 1996 if (!MainFrameImpl())
1994 return; 1997 return;
1995 1998
1996 last_frame_time_monotonic_ = last_frame_time_monotonic; 1999 last_frame_time_monotonic_ = last_frame_time_monotonic;
1997 2000
1998 DocumentLifecycle::AllowThrottlingScope throttling_scope( 2001 DocumentLifecycle::AllowThrottlingScope throttling_scope(
1999 MainFrameImpl()->GetFrame()->GetDocument()->Lifecycle()); 2002 MainFrameImpl()->GetFrame()->GetDocument()->Lifecycle());
(...skipping 2119 matching lines...) Expand 10 before | Expand all | Expand 10 after
4119 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) 4122 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame())
4120 return nullptr; 4123 return nullptr;
4121 return focused_frame; 4124 return focused_frame;
4122 } 4125 }
4123 4126
4124 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { 4127 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const {
4125 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; 4128 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr;
4126 } 4129 }
4127 4130
4128 } // namespace blink 4131 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/ChromeClientImpl.cpp ('k') | third_party/WebKit/public/web/WebWidgetClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698