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

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

Issue 2453553003: Disable overlay scrollbars in Blink when hidden by the compositor. (Closed)
Patch Set: 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) 2008, 2011 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008, 2011 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 // animations. 246 // animations.
247 virtual bool scheduleAnimation(); 247 virtual bool scheduleAnimation();
248 virtual void serviceScrollAnimations(double monotonicTime); 248 virtual void serviceScrollAnimations(double monotonicTime);
249 virtual void updateCompositorScrollAnimations(); 249 virtual void updateCompositorScrollAnimations();
250 virtual void registerForAnimation() {} 250 virtual void registerForAnimation() {}
251 virtual void deregisterForAnimation() {} 251 virtual void deregisterForAnimation() {}
252 252
253 virtual bool usesCompositedScrolling() const { return false; } 253 virtual bool usesCompositedScrolling() const { return false; }
254 virtual bool shouldScrollOnMainThread() const; 254 virtual bool shouldScrollOnMainThread() const;
255 255
256 // Overlay scrollbars can "fade-out" when inactive.
257 virtual bool scrollbarsHidden() const;
258 virtual void setScrollbarsHidden(bool);
259 virtual void didChangeScrollbarsHidden(){};
260
256 // Returns true if the GraphicsLayer tree needs to be rebuilt. 261 // Returns true if the GraphicsLayer tree needs to be rebuilt.
257 virtual bool updateAfterCompositingChange() { return false; } 262 virtual bool updateAfterCompositingChange() { return false; }
258 263
259 virtual bool userInputScrollable(ScrollbarOrientation) const = 0; 264 virtual bool userInputScrollable(ScrollbarOrientation) const = 0;
260 virtual bool shouldPlaceVerticalScrollbarOnLeft() const = 0; 265 virtual bool shouldPlaceVerticalScrollbarOnLeft() const = 0;
261 266
262 // Convenience functions 267 // Convenience functions
263 float scrollOffset(ScrollbarOrientation orientation) { 268 float scrollOffset(ScrollbarOrientation orientation) {
264 return orientation == HorizontalScrollbar ? scrollOffsetInt().width() 269 return orientation == HorizontalScrollbar ? scrollOffsetInt().width()
265 : scrollOffsetInt().height(); 270 : scrollOffsetInt().height();
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 mutable Member<ScrollAnimatorBase> m_scrollAnimator; 396 mutable Member<ScrollAnimatorBase> m_scrollAnimator;
392 mutable Member<ProgrammaticScrollAnimator> m_programmaticScrollAnimator; 397 mutable Member<ProgrammaticScrollAnimator> m_programmaticScrollAnimator;
393 398
394 unsigned m_scrollbarOverlayColorTheme : 2; 399 unsigned m_scrollbarOverlayColorTheme : 2;
395 400
396 unsigned m_scrollOriginChanged : 1; 401 unsigned m_scrollOriginChanged : 1;
397 402
398 unsigned m_horizontalScrollbarNeedsPaintInvalidation : 1; 403 unsigned m_horizontalScrollbarNeedsPaintInvalidation : 1;
399 unsigned m_verticalScrollbarNeedsPaintInvalidation : 1; 404 unsigned m_verticalScrollbarNeedsPaintInvalidation : 1;
400 unsigned m_scrollCornerNeedsPaintInvalidation : 1; 405 unsigned m_scrollCornerNeedsPaintInvalidation : 1;
406 unsigned m_scrollbarsHidden : 1;
401 407
402 // There are 6 possible combinations of writing mode and direction. Scroll 408 // There are 6 possible combinations of writing mode and direction. Scroll
403 // origin will be non-zero in the x or y axis if there is any reversed 409 // origin will be non-zero in the x or y axis if there is any reversed
404 // direction or writing-mode. The combinations are: 410 // direction or writing-mode. The combinations are:
405 // writing-mode / direction scrollOrigin.x() set scrollOrigin.y() set 411 // writing-mode / direction scrollOrigin.x() set scrollOrigin.y() set
406 // horizontal-tb / ltr NO NO 412 // horizontal-tb / ltr NO NO
407 // horizontal-tb / rtl YES NO 413 // horizontal-tb / rtl YES NO
408 // vertical-lr / ltr NO NO 414 // vertical-lr / ltr NO NO
409 // vertical-lr / rtl NO YES 415 // vertical-lr / rtl NO YES
410 // vertical-rl / ltr YES NO 416 // vertical-rl / ltr YES NO
411 // vertical-rl / rtl YES YES 417 // vertical-rl / rtl YES YES
412 IntPoint m_scrollOrigin; 418 IntPoint m_scrollOrigin;
413 }; 419 };
414 420
415 } // namespace blink 421 } // namespace blink
416 422
417 #endif // ScrollableArea_h 423 #endif // ScrollableArea_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698