| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 3369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3380 return maximumPosition.expandedTo(minimumScrollPosition()); | 3380 return maximumPosition.expandedTo(minimumScrollPosition()); |
| 3381 } | 3381 } |
| 3382 | 3382 |
| 3383 void FrameView::addChild(Widget* child) { | 3383 void FrameView::addChild(Widget* child) { |
| 3384 ASSERT(child != this && !child->parent()); | 3384 ASSERT(child != this && !child->parent()); |
| 3385 child->setParent(this); | 3385 child->setParent(this); |
| 3386 m_children.add(child); | 3386 m_children.add(child); |
| 3387 } | 3387 } |
| 3388 | 3388 |
| 3389 void FrameView::setHasHorizontalScrollbar(bool hasBar) { | 3389 void FrameView::setHasHorizontalScrollbar(bool hasBar) { |
| 3390 DCHECK(m_frame->settings()); | 3390 if (m_frame->settings() && m_frame->settings()->hideScrollbars()) |
| 3391 if (m_frame->settings()->hideScrollbars()) | |
| 3392 hasBar = false; | 3391 hasBar = false; |
| 3393 | 3392 |
| 3394 if (hasBar == !!m_horizontalScrollbar) | 3393 if (hasBar == !!m_horizontalScrollbar) |
| 3395 return; | 3394 return; |
| 3396 | 3395 |
| 3397 if (hasBar) { | 3396 if (hasBar) { |
| 3398 m_horizontalScrollbar = createScrollbar(HorizontalScrollbar); | 3397 m_horizontalScrollbar = createScrollbar(HorizontalScrollbar); |
| 3399 addChild(m_horizontalScrollbar.get()); | 3398 addChild(m_horizontalScrollbar.get()); |
| 3400 didAddScrollbar(*m_horizontalScrollbar, HorizontalScrollbar); | 3399 didAddScrollbar(*m_horizontalScrollbar, HorizontalScrollbar); |
| 3401 m_horizontalScrollbar->styleChanged(); | 3400 m_horizontalScrollbar->styleChanged(); |
| 3402 } else { | 3401 } else { |
| 3403 willRemoveScrollbar(*m_horizontalScrollbar, HorizontalScrollbar); | 3402 willRemoveScrollbar(*m_horizontalScrollbar, HorizontalScrollbar); |
| 3404 // If the scrollbar has been marked as overlapping the window resizer, | 3403 // If the scrollbar has been marked as overlapping the window resizer, |
| 3405 // then its removal should reduce the count. | 3404 // then its removal should reduce the count. |
| 3406 if (m_horizontalScrollbar->overlapsResizer()) | 3405 if (m_horizontalScrollbar->overlapsResizer()) |
| 3407 adjustScrollbarsAvoidingResizerCount(-1); | 3406 adjustScrollbarsAvoidingResizerCount(-1); |
| 3408 removeChild(m_horizontalScrollbar.get()); | 3407 removeChild(m_horizontalScrollbar.get()); |
| 3409 m_horizontalScrollbar->disconnectFromScrollableArea(); | 3408 m_horizontalScrollbar->disconnectFromScrollableArea(); |
| 3410 m_horizontalScrollbar = nullptr; | 3409 m_horizontalScrollbar = nullptr; |
| 3411 } | 3410 } |
| 3412 | 3411 |
| 3413 setScrollCornerNeedsPaintInvalidation(); | 3412 setScrollCornerNeedsPaintInvalidation(); |
| 3414 } | 3413 } |
| 3415 | 3414 |
| 3416 void FrameView::setHasVerticalScrollbar(bool hasBar) { | 3415 void FrameView::setHasVerticalScrollbar(bool hasBar) { |
| 3417 DCHECK(m_frame->settings()); | 3416 if (m_frame->settings() && m_frame->settings()->hideScrollbars()) |
| 3418 if (m_frame->settings()->hideScrollbars()) | |
| 3419 hasBar = false; | 3417 hasBar = false; |
| 3420 | 3418 |
| 3421 if (hasBar == !!m_verticalScrollbar) | 3419 if (hasBar == !!m_verticalScrollbar) |
| 3422 return; | 3420 return; |
| 3423 | 3421 |
| 3424 if (hasBar) { | 3422 if (hasBar) { |
| 3425 m_verticalScrollbar = createScrollbar(VerticalScrollbar); | 3423 m_verticalScrollbar = createScrollbar(VerticalScrollbar); |
| 3426 addChild(m_verticalScrollbar.get()); | 3424 addChild(m_verticalScrollbar.get()); |
| 3427 didAddScrollbar(*m_verticalScrollbar, VerticalScrollbar); | 3425 didAddScrollbar(*m_verticalScrollbar, VerticalScrollbar); |
| 3428 m_verticalScrollbar->styleChanged(); | 3426 m_verticalScrollbar->styleChanged(); |
| (...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4505 } | 4503 } |
| 4506 | 4504 |
| 4507 bool FrameView::canThrottleRendering() const { | 4505 bool FrameView::canThrottleRendering() const { |
| 4508 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) | 4506 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) |
| 4509 return false; | 4507 return false; |
| 4510 return m_subtreeThrottled || | 4508 return m_subtreeThrottled || |
| 4511 (m_hiddenForThrottling && m_crossOriginForThrottling); | 4509 (m_hiddenForThrottling && m_crossOriginForThrottling); |
| 4512 } | 4510 } |
| 4513 | 4511 |
| 4514 } // namespace blink | 4512 } // namespace blink |
| OLD | NEW |