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

Side by Side Diff: Source/core/loader/FrameLoader.cpp

Issue 1208433002: Replaced adjustScrollPositionWithinRange with clampScrollPosition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Unremoved DoublePoint version of FrameView::setScrollOffset Created 5 years, 5 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) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
8 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
(...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after
1120 m_frame->page()->setPageScaleFactor(m_currentItem->pageScaleFactor(), fr ameScrollOffset); 1120 m_frame->page()->setPageScaleFactor(m_currentItem->pageScaleFactor(), fr ameScrollOffset);
1121 1121
1122 // If the pinch viewport's offset is (-1, -1) it means the history item 1122 // If the pinch viewport's offset is (-1, -1) it means the history item
1123 // is an old version of HistoryItem so distribute the scroll between 1123 // is an old version of HistoryItem so distribute the scroll between
1124 // the main frame and the pinch viewport as best as we can. 1124 // the main frame and the pinch viewport as best as we can.
1125 if (pinchViewportOffset.x() == -1 && pinchViewportOffset.y() == -1) 1125 if (pinchViewportOffset.x() == -1 && pinchViewportOffset.y() == -1)
1126 pinchViewportOffset = FloatPoint(frameScrollOffset - view->scrollPos ition()); 1126 pinchViewportOffset = FloatPoint(frameScrollOffset - view->scrollPos ition());
1127 1127
1128 m_frame->host()->pinchViewport().setLocation(pinchViewportOffset); 1128 m_frame->host()->pinchViewport().setLocation(pinchViewportOffset);
1129 } else { 1129 } else {
1130 IntPoint adjustedScrollPosition = view->adjustScrollPositionWithinRange( m_currentItem->scrollPoint()); 1130 IntPoint adjustedScrollPosition = view->clampScrollPosition(m_currentIte m->scrollPoint());
1131 if (adjustedScrollPosition != view->scrollPosition()) 1131 if (adjustedScrollPosition != view->scrollPosition())
1132 view->setScrollPosition(adjustedScrollPosition, ProgrammaticScroll); 1132 view->setScrollPosition(adjustedScrollPosition, ProgrammaticScroll);
1133 } 1133 }
1134 1134
1135 if (m_frame->isMainFrame()) { 1135 if (m_frame->isMainFrame()) {
1136 if (ScrollingCoordinator* scrollingCoordinator = m_frame->page()->scroll ingCoordinator()) 1136 if (ScrollingCoordinator* scrollingCoordinator = m_frame->page()->scroll ingCoordinator())
1137 scrollingCoordinator->frameViewRootLayerDidChange(view); 1137 scrollingCoordinator->frameViewRootLayerDidChange(view);
1138 } 1138 }
1139 documentLoader()->initialScrollState().didRestoreFromHistory = true; 1139 documentLoader()->initialScrollState().didRestoreFromHistory = true;
1140 } 1140 }
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1486 // FIXME: We need a way to propagate insecure requests policy flags to 1486 // FIXME: We need a way to propagate insecure requests policy flags to
1487 // out-of-process frames. For now, we'll always use default behavior. 1487 // out-of-process frames. For now, we'll always use default behavior.
1488 if (!parentFrame->isLocalFrame()) 1488 if (!parentFrame->isLocalFrame())
1489 return nullptr; 1489 return nullptr;
1490 1490
1491 ASSERT(toLocalFrame(parentFrame)->document()); 1491 ASSERT(toLocalFrame(parentFrame)->document());
1492 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ; 1492 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ;
1493 } 1493 }
1494 1494
1495 } // namespace blink 1495 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/RootFrameViewport.cpp ('k') | Source/core/paint/DeprecatedPaintLayerScrollableArea.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698