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

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

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

Powered by Google App Engine
This is Rietveld 408576698