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

Side by Side Diff: Source/platform/scroll/Scrollbar.cpp

Issue 246293006: Blink Support for Overlay Scrollbar Animation Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix try server compile error Created 6 years, 6 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
OLDNEW
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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 m_enabled = e; 531 m_enabled = e;
532 theme()->updateEnabledState(this); 532 theme()->updateEnabledState(this);
533 invalidate(); 533 invalidate();
534 } 534 }
535 535
536 bool Scrollbar::isOverlayScrollbar() const 536 bool Scrollbar::isOverlayScrollbar() const
537 { 537 {
538 return m_theme->usesOverlayScrollbars(); 538 return m_theme->usesOverlayScrollbars();
539 } 539 }
540 540
541 bool Scrollbar::isDuringStateTransitionAnimation() const
542 {
543 return m_enabled && isOverlayScrollbar() && m_scrollableArea->isDuringStateT ransitionAnimation();
544 }
545
546 double Scrollbar::stateTransitionProgress() const
547 {
548 return m_stateTransitionProgress;
549 }
550
551 blink::WebThemeEngine::State Scrollbar::stateTransitionStartState() const
552 {
553 return m_startState;
554 }
555
556 blink::WebThemeEngine::State Scrollbar::stateTransitionEndState() const
557 {
558 return m_endState;
559 }
560
561 void Scrollbar::updateStateTransitionData(blink::WebThemeEngine::State startStat e, blink::WebThemeEngine::State endState, double progress)
562 {
563 m_startState = startState;
564 m_endState = endState;
565 m_stateTransitionProgress = progress;
566 updateThumb();
567 }
541 bool Scrollbar::shouldParticipateInHitTesting() 568 bool Scrollbar::shouldParticipateInHitTesting()
542 { 569 {
543 // Non-overlay scrollbars should always participate in hit testing. 570 // Non-overlay scrollbars should always participate in hit testing.
544 if (!isOverlayScrollbar()) 571 if (!isOverlayScrollbar())
545 return true; 572 return true;
546 return m_scrollableArea->scrollAnimator()->shouldScrollbarParticipateInHitTe sting(this); 573 return m_scrollableArea->scrollAnimator()->shouldScrollbarParticipateInHitTe sting(this);
547 } 574 }
548 575
549 bool Scrollbar::isWindowActive() const 576 bool Scrollbar::isWindowActive() const
550 { 577 {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 if (!m_scrollableArea) 624 if (!m_scrollableArea)
598 return 0; 625 return 0;
599 626
600 if (m_orientation == HorizontalScrollbar) 627 if (m_orientation == HorizontalScrollbar)
601 return m_scrollableArea->scrollPosition().x() - m_scrollableArea->minimu mScrollPosition().x(); 628 return m_scrollableArea->scrollPosition().x() - m_scrollableArea->minimu mScrollPosition().x();
602 629
603 return m_scrollableArea->scrollPosition().y() - m_scrollableArea->minimumScr ollPosition().y(); 630 return m_scrollableArea->scrollPosition().y() - m_scrollableArea->minimumScr ollPosition().y();
604 } 631 }
605 632
606 } // namespace WebCore 633 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698