OLD | NEW |
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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 OwnPtr<WebScrollbarLayer> webScrollbarLayer; | 327 OwnPtr<WebScrollbarLayer> webScrollbarLayer; |
328 if (settings->useSolidColorScrollbars()) { | 328 if (settings->useSolidColorScrollbars()) { |
329 ASSERT(RuntimeEnabledFeatures::overlayScrollbarsEnabled()); | 329 ASSERT(RuntimeEnabledFeatures::overlayScrollbarsEnabled()); |
330 webScrollbarLayer = createSolidColorScrollbarLayer(orientation,
scrollbar->theme()->thumbThickness(scrollbar), scrollbar->theme()->trackPosition
(scrollbar), scrollableArea->shouldPlaceVerticalScrollbarOnLeft()); | 330 webScrollbarLayer = createSolidColorScrollbarLayer(orientation,
scrollbar->theme()->thumbThickness(scrollbar), scrollbar->theme()->trackPosition
(scrollbar), scrollableArea->shouldPlaceVerticalScrollbarOnLeft()); |
331 } else { | 331 } else { |
332 webScrollbarLayer = createScrollbarLayer(scrollbar); | 332 webScrollbarLayer = createScrollbarLayer(scrollbar); |
333 } | 333 } |
334 scrollbarLayer = addWebScrollbarLayer(scrollableArea, orientation, w
ebScrollbarLayer.release()); | 334 scrollbarLayer = addWebScrollbarLayer(scrollableArea, orientation, w
ebScrollbarLayer.release()); |
335 } | 335 } |
336 | 336 |
| 337 WebLayer* scrollLayer = toWebLayer(scrollableArea->layerForScrolling()); |
| 338 WebLayer* containerLayer = toWebLayer(scrollableArea->layerForContainer(
)); |
| 339 setupScrollbarLayer(scrollbarGraphicsLayer, scrollbarLayer, scrollLayer,
containerLayer); |
| 340 |
337 // Root layer non-overlay scrollbars should be marked opaque to disable | 341 // Root layer non-overlay scrollbars should be marked opaque to disable |
338 // blending. | 342 // blending. |
339 bool isOpaqueScrollbar = !scrollbar->isOverlayScrollbar(); | 343 bool isOpaqueScrollbar = !scrollbar->isOverlayScrollbar(); |
340 scrollbarGraphicsLayer->setContentsOpaque(isMainFrame && isOpaqueScrollb
ar); | 344 scrollbarGraphicsLayer->setContentsOpaque(isMainFrame && isOpaqueScrollb
ar); |
341 | |
342 WebLayer* scrollLayer = toWebLayer(scrollableArea->layerForScrolling()); | |
343 WebLayer* containerLayer = toWebLayer(scrollableArea->layerForContainer(
)); | |
344 setupScrollbarLayer(scrollbarGraphicsLayer, scrollbarLayer, scrollLayer,
containerLayer); | |
345 } else | 345 } else |
346 removeWebScrollbarLayer(scrollableArea, orientation); | 346 removeWebScrollbarLayer(scrollableArea, orientation); |
347 } | 347 } |
348 | 348 |
349 bool ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea* sc
rollableArea) | 349 bool ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea* sc
rollableArea) |
350 { | 350 { |
351 GraphicsLayer* scrollLayer = scrollableArea->layerForScrolling(); | 351 GraphicsLayer* scrollLayer = scrollableArea->layerForScrolling(); |
352 | 352 |
353 if (scrollLayer) { | 353 if (scrollLayer) { |
354 ASSERT(m_page); | 354 ASSERT(m_page); |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 bool frameIsScrollable = frameView && frameView->isScrollable(); | 975 bool frameIsScrollable = frameView && frameView->isScrollable(); |
976 if (frameIsScrollable != m_wasFrameScrollable) | 976 if (frameIsScrollable != m_wasFrameScrollable) |
977 return true; | 977 return true; |
978 | 978 |
979 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : 0) | 979 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : 0) |
980 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds(
); | 980 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds(
); |
981 return false; | 981 return false; |
982 } | 982 } |
983 | 983 |
984 } // namespace blink | 984 } // namespace blink |
OLD | NEW |