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

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: add test + rebase 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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 scrollAnimator->willRemoveHorizontalScrollbar(scrollbar); 375 scrollAnimator->willRemoveHorizontalScrollbar(scrollbar);
376 } 376 }
377 } 377 }
378 378
379 void ScrollableArea::contentsResized() { 379 void ScrollableArea::contentsResized() {
380 if (ScrollAnimatorBase* scrollAnimator = existingScrollAnimator()) 380 if (ScrollAnimatorBase* scrollAnimator = existingScrollAnimator())
381 scrollAnimator->contentsResized(); 381 scrollAnimator->contentsResized();
382 } 382 }
383 383
384 bool ScrollableArea::hasOverlayScrollbars() const { 384 bool ScrollableArea::hasOverlayScrollbars() const {
385 Scrollbar* vScrollbar = verticalScrollbar(); 385 return (horizontalScrollbar() &&
386 if (vScrollbar && vScrollbar->isOverlayScrollbar()) 386 horizontalScrollbar()->isOverlayScrollbar()) ||
387 return true; 387 (verticalScrollbar() && verticalScrollbar()->isOverlayScrollbar());
388 Scrollbar* hScrollbar = horizontalScrollbar();
389 return hScrollbar && hScrollbar->isOverlayScrollbar();
390 } 388 }
391 389
392 void ScrollableArea::setScrollbarOverlayColorTheme( 390 void ScrollableArea::setScrollbarOverlayColorTheme(
393 ScrollbarOverlayColorTheme overlayTheme) { 391 ScrollbarOverlayColorTheme overlayTheme) {
394 m_scrollbarOverlayColorTheme = overlayTheme; 392 m_scrollbarOverlayColorTheme = overlayTheme;
395 393
396 if (Scrollbar* scrollbar = horizontalScrollbar()) { 394 if (Scrollbar* scrollbar = horizontalScrollbar()) {
397 ScrollbarTheme::theme().updateScrollbarOverlayColorTheme(*scrollbar); 395 ScrollbarTheme::theme().updateScrollbarOverlayColorTheme(*scrollbar);
398 scrollbar->setNeedsPaintInvalidation(AllParts); 396 scrollbar->setNeedsPaintInvalidation(AllParts);
399 } 397 }
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 return IntSize(std::max(0, size.width() - verticalScrollbarWidth()), 590 return IntSize(std::max(0, size.width() - verticalScrollbarWidth()),
593 std::max(0, size.height() - horizontalScrollbarHeight())); 591 std::max(0, size.height() - horizontalScrollbarHeight()));
594 } 592 }
595 593
596 DEFINE_TRACE(ScrollableArea) { 594 DEFINE_TRACE(ScrollableArea) {
597 visitor->trace(m_scrollAnimator); 595 visitor->trace(m_scrollAnimator);
598 visitor->trace(m_programmaticScrollAnimator); 596 visitor->trace(m_programmaticScrollAnimator);
599 } 597 }
600 598
601 } // namespace blink 599 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698