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

Side by Side Diff: Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 199253002: Made PinchViewport a ScrollableArea (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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
« no previous file with comments | « Source/core/frame/PinchViewport.cpp ('k') | Source/platform/graphics/GraphicsLayer.cpp » ('j') | 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 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 setupScrollbarLayer(scrollbarGraphicsLayer, scrollbarLayer, scrollLayer, containerLayer); 347 setupScrollbarLayer(scrollbarGraphicsLayer, scrollbarLayer, scrollLayer, containerLayer);
348 } else 348 } else
349 removeWebScrollbarLayer(scrollableArea, orientation); 349 removeWebScrollbarLayer(scrollableArea, orientation);
350 } 350 }
351 351
352 bool ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea* sc rollableArea) 352 bool ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea* sc rollableArea)
353 { 353 {
354 GraphicsLayer* scrollLayer = scrollableArea->layerForScrolling(); 354 GraphicsLayer* scrollLayer = scrollableArea->layerForScrolling();
355 355
356 if (scrollLayer) { 356 if (scrollLayer) {
357 bool isMainFrame = isForMainFrame(scrollableArea); 357 // With pinch virtual viewport we no longer need to special case the mai n frame.
358 scrollLayer->setScrollableArea(scrollableArea, isMainFrame); 358 bool pinchVirtualViewportEnabled = m_page->mainFrame()->document()->sett ings()->pinchVirtualViewportEnabled();
359 bool layerScrollShouldFireGraphicsLayerDidScroll = isForMainFrame(scroll ableArea) && !pinchVirtualViewportEnabled;
360 scrollLayer->setScrollableArea(scrollableArea, layerScrollShouldFireGrap hicsLayerDidScroll);
359 } 361 }
360 362
361 WebLayer* webLayer = toWebLayer(scrollableArea->layerForScrolling()); 363 WebLayer* webLayer = toWebLayer(scrollableArea->layerForScrolling());
362 WebLayer* containerLayer = toWebLayer(scrollableArea->layerForContainer()); 364 WebLayer* containerLayer = toWebLayer(scrollableArea->layerForContainer());
363 if (webLayer) { 365 if (webLayer) {
364 webLayer->setScrollClipLayer(containerLayer); 366 webLayer->setScrollClipLayer(containerLayer);
365 webLayer->setScrollPosition(IntPoint(scrollableArea->scrollPosition() - scrollableArea->minimumScrollPosition())); 367 webLayer->setScrollPosition(IntPoint(scrollableArea->scrollPosition() - scrollableArea->minimumScrollPosition()));
366 webLayer->setBounds(scrollableArea->contentsSize()); 368 webLayer->setBounds(scrollableArea->contentsSize());
367 bool canScrollX = scrollableArea->userInputScrollable(HorizontalScrollba r); 369 bool canScrollX = scrollableArea->userInputScrollable(HorizontalScrollba r);
368 bool canScrollY = scrollableArea->userInputScrollable(VerticalScrollbar) ; 370 bool canScrollY = scrollableArea->userInputScrollable(VerticalScrollbar) ;
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 bool frameIsScrollable = frameView && frameView->isScrollable(); 953 bool frameIsScrollable = frameView && frameView->isScrollable();
952 if (frameIsScrollable != m_wasFrameScrollable) 954 if (frameIsScrollable != m_wasFrameScrollable)
953 return true; 955 return true;
954 956
955 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : 0) 957 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : 0)
956 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds( ); 958 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds( );
957 return false; 959 return false;
958 } 960 }
959 961
960 } // namespace WebCore 962 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/frame/PinchViewport.cpp ('k') | Source/platform/graphics/GraphicsLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698