OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
301 scrollbarMargin = ScrollbarTheme::theme()->scrollbarMargin(); | 301 scrollbarMargin = ScrollbarTheme::theme()->scrollbarMargin(); |
302 #endif | 302 #endif |
303 | 303 |
304 if (!webScrollbarLayer) { | 304 if (!webScrollbarLayer) { |
305 ScrollingCoordinator* coordinator = frameHost().page().scrollingCoordina tor(); | 305 ScrollingCoordinator* coordinator = frameHost().page().scrollingCoordina tor(); |
306 ASSERT(coordinator); | 306 ASSERT(coordinator); |
307 ScrollbarOrientation webcoreOrientation = isHorizontal ? HorizontalScrol lbar : VerticalScrollbar; | 307 ScrollbarOrientation webcoreOrientation = isHorizontal ? HorizontalScrol lbar : VerticalScrollbar; |
308 webScrollbarLayer = coordinator->createSolidColorScrollbarLayer(webcoreO rientation, thumbThickness, scrollbarMargin, false); | 308 webScrollbarLayer = coordinator->createSolidColorScrollbarLayer(webcoreO rientation, thumbThickness, scrollbarMargin, false); |
309 | 309 |
310 webScrollbarLayer->setClipLayer(m_innerViewportContainerLayer->platformL ayer()); | 310 webScrollbarLayer->setClipLayer(m_innerViewportContainerLayer->platformL ayer()); |
311 | |
312 // The compositor will control the scrollbar's visibility. Set to invisi ble by defualt | |
313 // so scrollbars don't show up in layout tests. | |
314 webScrollbarLayer->layer()->setOpacity(0); | |
gmorrita
2014/10/30 18:48:47
Apparently having some API on WebScrollbarLayer lo
| |
315 | |
311 scrollbarGraphicsLayer->setContentsToPlatformLayer(webScrollbarLayer->la yer()); | 316 scrollbarGraphicsLayer->setContentsToPlatformLayer(webScrollbarLayer->la yer()); |
312 scrollbarGraphicsLayer->setDrawsContent(false); | 317 scrollbarGraphicsLayer->setDrawsContent(false); |
313 } | 318 } |
314 | 319 |
315 int xPosition = isHorizontal ? 0 : m_innerViewportContainerLayer->size().wid th() - scrollbarThickness; | 320 int xPosition = isHorizontal ? 0 : m_innerViewportContainerLayer->size().wid th() - scrollbarThickness; |
316 int yPosition = isHorizontal ? m_innerViewportContainerLayer->size().height( ) - scrollbarThickness : 0; | 321 int yPosition = isHorizontal ? m_innerViewportContainerLayer->size().height( ) - scrollbarThickness : 0; |
317 int width = isHorizontal ? m_innerViewportContainerLayer->size().width() - s crollbarThickness : scrollbarThickness; | 322 int width = isHorizontal ? m_innerViewportContainerLayer->size().width() - s crollbarThickness : scrollbarThickness; |
318 int height = isHorizontal ? scrollbarThickness : m_innerViewportContainerLay er->size().height() - scrollbarThickness; | 323 int height = isHorizontal ? scrollbarThickness : m_innerViewportContainerLay er->size().height() - scrollbarThickness; |
319 | 324 |
320 // Use the GraphicsLayer to position the scrollbars. | 325 // Use the GraphicsLayer to position the scrollbars. |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
508 } else if (graphicsLayer == m_overlayScrollbarVertical.get()) { | 513 } else if (graphicsLayer == m_overlayScrollbarVertical.get()) { |
509 name = "Overlay Scrollbar Vertical Layer"; | 514 name = "Overlay Scrollbar Vertical Layer"; |
510 } else { | 515 } else { |
511 ASSERT_NOT_REACHED(); | 516 ASSERT_NOT_REACHED(); |
512 } | 517 } |
513 | 518 |
514 return name; | 519 return name; |
515 } | 520 } |
516 | 521 |
517 } // namespace blink | 522 } // namespace blink |
OLD | NEW |