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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 2289213002: Implement Middle Click Autoscroll on all platforms not just Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename the files. Created 4 years, 3 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 adjustedDelta = static_cast<int>(adjustedDelta * sqrt(static_cast<double >(-adjustedDelta))) + 1; 958 adjustedDelta = static_cast<int>(adjustedDelta * sqrt(static_cast<double >(-adjustedDelta))) + 1;
959 959
960 return adjustedDelta; 960 return adjustedDelta;
961 } 961 }
962 962
963 static inline IntSize adjustedScrollDelta(const IntSize& delta) 963 static inline IntSize adjustedScrollDelta(const IntSize& delta)
964 { 964 {
965 return IntSize(adjustedScrollDelta(delta.width()), adjustedScrollDelta(delta .height())); 965 return IntSize(adjustedScrollDelta(delta.width()), adjustedScrollDelta(delta .height()));
966 } 966 }
967 967
968 void LayoutBox::panScroll(const IntPoint& sourcePoint) 968 void LayoutBox::middleClickAutoscroll(const IntPoint& sourcePoint)
969 { 969 {
970 LocalFrame* frame = this->frame(); 970 LocalFrame* frame = this->frame();
971 if (!frame) 971 if (!frame)
972 return; 972 return;
973 973
974 IntPoint lastKnownMousePosition = frame->eventHandler().lastKnownMousePositi on(); 974 IntPoint lastKnownMousePosition = frame->eventHandler().lastKnownMousePositi on();
975 975
976 // We need to check if the last known mouse position is out of the window. W hen the mouse is out of the window, the position is incoherent 976 // We need to check if the last known mouse position is out of the window. W hen the mouse is out of the window, the position is incoherent
977 static IntPoint previousMousePosition; 977 static IntPoint previousMousePosition;
978 if (lastKnownMousePosition.x() < 0 || lastKnownMousePosition.y() < 0) 978 if (lastKnownMousePosition.x() < 0 || lastKnownMousePosition.y() < 0)
(...skipping 3864 matching lines...) Expand 10 before | Expand all | Expand 10 after
4843 m_rareData->m_snapAreas->remove(&snapArea); 4843 m_rareData->m_snapAreas->remove(&snapArea);
4844 } 4844 }
4845 } 4845 }
4846 4846
4847 SnapAreaSet* LayoutBox::snapAreas() const 4847 SnapAreaSet* LayoutBox::snapAreas() const
4848 { 4848 {
4849 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; 4849 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr;
4850 } 4850 }
4851 4851
4852 } // namespace blink 4852 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698