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

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

Issue 313263005: Code cleanup: remove unnecessary casts. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 // Special handling for slow-path fling gestures. 625 // Special handling for slow-path fling gestures.
626 switch (event.type) { 626 switch (event.type) {
627 case WebInputEvent::GestureFlingStart: { 627 case WebInputEvent::GestureFlingStart: {
628 if (mainFrameImpl()->frame()->eventHandler().isScrollbarHandlingGestures ()) 628 if (mainFrameImpl()->frame()->eventHandler().isScrollbarHandlingGestures ())
629 break; 629 break;
630 m_client->cancelScheduledContentIntents(); 630 m_client->cancelScheduledContentIntents();
631 m_positionOnFlingStart = WebPoint(event.x / pageScaleFactor(), event.y / pageScaleFactor()); 631 m_positionOnFlingStart = WebPoint(event.x / pageScaleFactor(), event.y / pageScaleFactor());
632 m_globalPositionOnFlingStart = WebPoint(event.globalX, event.globalY); 632 m_globalPositionOnFlingStart = WebPoint(event.globalX, event.globalY);
633 m_flingModifier = event.modifiers; 633 m_flingModifier = event.modifiers;
634 m_flingSourceDevice = event.sourceDevice; 634 m_flingSourceDevice = event.sourceDevice;
635 OwnPtr<WebGestureCurve> flingCurve = adoptPtr(Platform::current()->creat eFlingAnimationCurve(static_cast<WebGestureDevice>(event.sourceDevice), WebFloat Point(event.data.flingStart.velocityX, event.data.flingStart.velocityY), WebSize ())); 635 OwnPtr<WebGestureCurve> flingCurve = adoptPtr(Platform::current()->creat eFlingAnimationCurve(event.sourceDevice, WebFloatPoint(event.data.flingStart.vel ocityX, event.data.flingStart.velocityY), WebSize()));
636 ASSERT(flingCurve); 636 ASSERT(flingCurve);
637 m_gestureAnimation = WebActiveGestureAnimation::createAtAnimationStart(f lingCurve.release(), this); 637 m_gestureAnimation = WebActiveGestureAnimation::createAtAnimationStart(f lingCurve.release(), this);
638 scheduleAnimation(); 638 scheduleAnimation();
639 eventSwallowed = true; 639 eventSwallowed = true;
640 640
641 m_client->didHandleGestureEvent(event, eventCancelled); 641 m_client->didHandleGestureEvent(event, eventCancelled);
642 return eventSwallowed; 642 return eventSwallowed;
643 } 643 }
644 case WebInputEvent::GestureFlingCancel: 644 case WebInputEvent::GestureFlingCancel:
645 if (endActiveFlingAnimation()) 645 if (endActiveFlingAnimation())
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 return eventSwallowed; 773 return eventSwallowed;
774 } 774 }
775 775
776 void WebViewImpl::transferActiveWheelFlingAnimation(const WebActiveWheelFlingPar ameters& parameters) 776 void WebViewImpl::transferActiveWheelFlingAnimation(const WebActiveWheelFlingPar ameters& parameters)
777 { 777 {
778 TRACE_EVENT0("webkit", "WebViewImpl::transferActiveWheelFlingAnimation"); 778 TRACE_EVENT0("webkit", "WebViewImpl::transferActiveWheelFlingAnimation");
779 ASSERT(!m_gestureAnimation); 779 ASSERT(!m_gestureAnimation);
780 m_positionOnFlingStart = parameters.point; 780 m_positionOnFlingStart = parameters.point;
781 m_globalPositionOnFlingStart = parameters.globalPoint; 781 m_globalPositionOnFlingStart = parameters.globalPoint;
782 m_flingModifier = parameters.modifiers; 782 m_flingModifier = parameters.modifiers;
783 OwnPtr<WebGestureCurve> curve = adoptPtr(Platform::current()->createFlingAni mationCurve(static_cast<WebGestureDevice>(parameters.sourceDevice), WebFloatPoin t(parameters.delta), parameters.cumulativeScroll)); 783 OwnPtr<WebGestureCurve> curve = adoptPtr(Platform::current()->createFlingAni mationCurve(parameters.sourceDevice, WebFloatPoint(parameters.delta), parameters .cumulativeScroll));
784 ASSERT(curve); 784 ASSERT(curve);
785 m_gestureAnimation = WebActiveGestureAnimation::createWithTimeOffset(curve.r elease(), this, parameters.startTime); 785 m_gestureAnimation = WebActiveGestureAnimation::createWithTimeOffset(curve.r elease(), this, parameters.startTime);
786 scheduleAnimation(); 786 scheduleAnimation();
787 } 787 }
788 788
789 bool WebViewImpl::endActiveFlingAnimation() 789 bool WebViewImpl::endActiveFlingAnimation()
790 { 790 {
791 if (m_gestureAnimation) { 791 if (m_gestureAnimation) {
792 m_gestureAnimation.clear(); 792 m_gestureAnimation.clear();
793 if (m_layerTreeView) 793 if (m_layerTreeView)
(...skipping 3269 matching lines...) Expand 10 before | Expand all | Expand 10 after
4063 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4063 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4064 4064
4065 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4065 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4066 return false; 4066 return false;
4067 4067
4068 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4068 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4069 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4069 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4070 } 4070 }
4071 4071
4072 } // namespace blink 4072 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698