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

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

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

Powered by Google App Engine
This is Rietveld 408576698