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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp

Issue 2454913003: MainFrame scrollbars should work with RFV instead of FV (Closed)
Patch Set: Fix VisualViewportTest Created 4 years, 1 month 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) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google Inc. All rights reserved.
3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 scrollAnimator->willRemoveHorizontalScrollbar(scrollbar); 376 scrollAnimator->willRemoveHorizontalScrollbar(scrollbar);
377 } 377 }
378 } 378 }
379 379
380 void ScrollableArea::contentsResized() { 380 void ScrollableArea::contentsResized() {
381 if (ScrollAnimatorBase* scrollAnimator = existingScrollAnimator()) 381 if (ScrollAnimatorBase* scrollAnimator = existingScrollAnimator())
382 scrollAnimator->contentsResized(); 382 scrollAnimator->contentsResized();
383 } 383 }
384 384
385 bool ScrollableArea::hasOverlayScrollbars() const { 385 bool ScrollableArea::hasOverlayScrollbars() const {
386 Scrollbar* vScrollbar = verticalScrollbar(); 386 return (horizontalScrollbar() &&
387 if (vScrollbar && vScrollbar->isOverlayScrollbar()) 387 horizontalScrollbar()->isOverlayScrollbar()) ||
388 return true; 388 (verticalScrollbar() && verticalScrollbar()->isOverlayScrollbar());
389 Scrollbar* hScrollbar = horizontalScrollbar();
390 return hScrollbar && hScrollbar->isOverlayScrollbar();
391 } 389 }
392 390
393 void ScrollableArea::setScrollbarOverlayColorTheme( 391 void ScrollableArea::setScrollbarOverlayColorTheme(
394 ScrollbarOverlayColorTheme overlayTheme) { 392 ScrollbarOverlayColorTheme overlayTheme) {
395 m_scrollbarOverlayColorTheme = overlayTheme; 393 m_scrollbarOverlayColorTheme = overlayTheme;
396 394
397 if (Scrollbar* scrollbar = horizontalScrollbar()) { 395 if (Scrollbar* scrollbar = horizontalScrollbar()) {
398 ScrollbarTheme::theme().updateScrollbarOverlayColorTheme(*scrollbar); 396 ScrollbarTheme::theme().updateScrollbarOverlayColorTheme(*scrollbar);
399 scrollbar->setNeedsPaintInvalidation(AllParts); 397 scrollbar->setNeedsPaintInvalidation(AllParts);
400 } 398 }
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 return IntSize(std::max(0, size.width() - verticalScrollbarWidth()), 614 return IntSize(std::max(0, size.width() - verticalScrollbarWidth()),
617 std::max(0, size.height() - horizontalScrollbarHeight())); 615 std::max(0, size.height() - horizontalScrollbarHeight()));
618 } 616 }
619 617
620 DEFINE_TRACE(ScrollableArea) { 618 DEFINE_TRACE(ScrollableArea) {
621 visitor->trace(m_scrollAnimator); 619 visitor->trace(m_scrollAnimator);
622 visitor->trace(m_programmaticScrollAnimator); 620 visitor->trace(m_programmaticScrollAnimator);
623 } 621 }
624 622
625 } // namespace blink 623 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698