| OLD | NEW |
| 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 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 .IsScrollbarHandlingGestures()) | 689 .IsScrollbarHandlingGestures()) |
| 690 break; | 690 break; |
| 691 EndActiveFlingAnimation(); | 691 EndActiveFlingAnimation(); |
| 692 position_on_fling_start_ = WebPoint(event.x, event.y); | 692 position_on_fling_start_ = WebPoint(event.x, event.y); |
| 693 global_position_on_fling_start_ = | 693 global_position_on_fling_start_ = |
| 694 WebPoint(event.global_x, event.global_y); | 694 WebPoint(event.global_x, event.global_y); |
| 695 fling_modifier_ = event.GetModifiers(); | 695 fling_modifier_ = event.GetModifiers(); |
| 696 fling_source_device_ = event.source_device; | 696 fling_source_device_ = event.source_device; |
| 697 DCHECK_NE(fling_source_device_, kWebGestureDeviceUninitialized); | 697 DCHECK_NE(fling_source_device_, kWebGestureDeviceUninitialized); |
| 698 std::unique_ptr<WebGestureCurve> fling_curve = | 698 std::unique_ptr<WebGestureCurve> fling_curve = |
| 699 Platform::Current()->CreateFlingAnimationCurve( | 699 WTF::WrapUnique(Platform::Current()->CreateFlingAnimationCurve( |
| 700 event.source_device, | 700 event.source_device, |
| 701 WebFloatPoint(event.data.fling_start.velocity_x, | 701 WebFloatPoint(event.data.fling_start.velocity_x, |
| 702 event.data.fling_start.velocity_y), | 702 event.data.fling_start.velocity_y), |
| 703 WebSize()); | 703 WebSize())); |
| 704 DCHECK(fling_curve); | 704 DCHECK(fling_curve); |
| 705 gesture_animation_ = WebActiveGestureAnimation::CreateAtAnimationStart( | 705 gesture_animation_ = WebActiveGestureAnimation::CreateAtAnimationStart( |
| 706 std::move(fling_curve), this); | 706 std::move(fling_curve), this); |
| 707 MainFrameImpl()->FrameWidget()->ScheduleAnimation(); | 707 MainFrameImpl()->FrameWidget()->ScheduleAnimation(); |
| 708 event_result = WebInputEventResult::kHandledSystem; | 708 event_result = WebInputEventResult::kHandledSystem; |
| 709 | 709 |
| 710 WebGestureEvent scaled_event = | 710 WebGestureEvent scaled_event = |
| 711 TransformWebGestureEvent(MainFrameImpl()->GetFrameView(), event); | 711 TransformWebGestureEvent(MainFrameImpl()->GetFrameView(), event); |
| 712 // Plugins may need to see GestureFlingStart to balance | 712 // Plugins may need to see GestureFlingStart to balance |
| 713 // GestureScrollBegin (since the former replaces GestureScrollEnd when | 713 // GestureScrollBegin (since the former replaces GestureScrollEnd when |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1001 } | 1001 } |
| 1002 | 1002 |
| 1003 void WebViewImpl::TransferActiveWheelFlingAnimation( | 1003 void WebViewImpl::TransferActiveWheelFlingAnimation( |
| 1004 const WebActiveWheelFlingParameters& parameters) { | 1004 const WebActiveWheelFlingParameters& parameters) { |
| 1005 TRACE_EVENT0("blink", "WebViewImpl::transferActiveWheelFlingAnimation"); | 1005 TRACE_EVENT0("blink", "WebViewImpl::transferActiveWheelFlingAnimation"); |
| 1006 DCHECK(!gesture_animation_); | 1006 DCHECK(!gesture_animation_); |
| 1007 position_on_fling_start_ = parameters.point; | 1007 position_on_fling_start_ = parameters.point; |
| 1008 global_position_on_fling_start_ = parameters.global_point; | 1008 global_position_on_fling_start_ = parameters.global_point; |
| 1009 fling_modifier_ = parameters.modifiers; | 1009 fling_modifier_ = parameters.modifiers; |
| 1010 std::unique_ptr<WebGestureCurve> curve = | 1010 std::unique_ptr<WebGestureCurve> curve = |
| 1011 Platform::Current()->CreateFlingAnimationCurve( | 1011 WTF::WrapUnique(Platform::Current()->CreateFlingAnimationCurve( |
| 1012 parameters.source_device, WebFloatPoint(parameters.delta), | 1012 parameters.source_device, WebFloatPoint(parameters.delta), |
| 1013 parameters.cumulative_scroll); | 1013 parameters.cumulative_scroll)); |
| 1014 DCHECK(curve); | 1014 DCHECK(curve); |
| 1015 gesture_animation_ = WebActiveGestureAnimation::CreateWithTimeOffset( | 1015 gesture_animation_ = WebActiveGestureAnimation::CreateWithTimeOffset( |
| 1016 std::move(curve), this, parameters.start_time); | 1016 std::move(curve), this, parameters.start_time); |
| 1017 DCHECK_NE(parameters.source_device, kWebGestureDeviceUninitialized); | 1017 DCHECK_NE(parameters.source_device, kWebGestureDeviceUninitialized); |
| 1018 fling_source_device_ = parameters.source_device; | 1018 fling_source_device_ = parameters.source_device; |
| 1019 MainFrameImpl()->FrameWidget()->ScheduleAnimation(); | 1019 MainFrameImpl()->FrameWidget()->ScheduleAnimation(); |
| 1020 } | 1020 } |
| 1021 | 1021 |
| 1022 bool WebViewImpl::EndActiveFlingAnimation() { | 1022 bool WebViewImpl::EndActiveFlingAnimation() { |
| 1023 if (gesture_animation_) { | 1023 if (gesture_animation_) { |
| (...skipping 3132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4156 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) | 4156 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) |
| 4157 return nullptr; | 4157 return nullptr; |
| 4158 return focused_frame; | 4158 return focused_frame; |
| 4159 } | 4159 } |
| 4160 | 4160 |
| 4161 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { | 4161 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { |
| 4162 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; | 4162 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; |
| 4163 } | 4163 } |
| 4164 | 4164 |
| 4165 } // namespace blink | 4165 } // namespace blink |
| OLD | NEW |