OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2008 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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 m_enabled = e; | 524 m_enabled = e; |
525 theme()->updateEnabledState(this); | 525 theme()->updateEnabledState(this); |
526 invalidate(); | 526 invalidate(); |
527 } | 527 } |
528 | 528 |
529 bool Scrollbar::isOverlayScrollbar() const | 529 bool Scrollbar::isOverlayScrollbar() const |
530 { | 530 { |
531 return m_theme->usesOverlayScrollbars(); | 531 return m_theme->usesOverlayScrollbars(); |
532 } | 532 } |
533 | 533 |
| 534 bool Scrollbar::isDuringStateTransitionAnimation() const |
| 535 { |
| 536 return m_enabled && isOverlayScrollbar() && m_scrollableArea->isDuringStateT
ransitionAnimation(); |
| 537 } |
| 538 |
| 539 double Scrollbar::stateTransitionProgress() const |
| 540 { |
| 541 return m_stateTransitionProgress; |
| 542 } |
| 543 |
| 544 blink::WebThemeEngine::State Scrollbar::stateTransitionStartState() const |
| 545 { |
| 546 return m_startState; |
| 547 } |
| 548 |
| 549 blink::WebThemeEngine::State Scrollbar::stateTransitionEndState() const |
| 550 { |
| 551 return m_endState; |
| 552 } |
| 553 |
| 554 void Scrollbar::updateStateTransitionData(blink::WebThemeEngine::State startStat
e, blink::WebThemeEngine::State endState, double progress) |
| 555 { |
| 556 m_startState = startState; |
| 557 m_endState = endState; |
| 558 m_stateTransitionProgress = progress; |
| 559 updateThumb(); |
| 560 } |
534 bool Scrollbar::shouldParticipateInHitTesting() | 561 bool Scrollbar::shouldParticipateInHitTesting() |
535 { | 562 { |
536 // Non-overlay scrollbars should always participate in hit testing. | 563 // Non-overlay scrollbars should always participate in hit testing. |
537 if (!isOverlayScrollbar()) | 564 if (!isOverlayScrollbar()) |
538 return true; | 565 return true; |
539 return m_scrollableArea->scrollAnimator()->shouldScrollbarParticipateInHitTe
sting(this); | 566 return m_scrollableArea->scrollAnimator()->shouldScrollbarParticipateInHitTe
sting(this); |
540 } | 567 } |
541 | 568 |
542 bool Scrollbar::isWindowActive() const | 569 bool Scrollbar::isWindowActive() const |
543 { | 570 { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 if (!m_scrollableArea) | 617 if (!m_scrollableArea) |
591 return 0; | 618 return 0; |
592 | 619 |
593 if (m_orientation == HorizontalScrollbar) | 620 if (m_orientation == HorizontalScrollbar) |
594 return m_scrollableArea->scrollPosition().x() - m_scrollableArea->minimu
mScrollPosition().x(); | 621 return m_scrollableArea->scrollPosition().x() - m_scrollableArea->minimu
mScrollPosition().x(); |
595 | 622 |
596 return m_scrollableArea->scrollPosition().y() - m_scrollableArea->minimumScr
ollPosition().y(); | 623 return m_scrollableArea->scrollPosition().y() - m_scrollableArea->minimumScr
ollPosition().y(); |
597 } | 624 } |
598 | 625 |
599 } // namespace blink | 626 } // namespace blink |
OLD | NEW |