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

Side by Side Diff: third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm

Issue 2701993002: DO NOT COMMIT: Results of running new (proposed) clang-format on Blink (Closed)
Patch Set: Created 3 years, 10 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) 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2010, 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 .updateScrollerStyle(); 271 .updateScrollerStyle();
272 } 272 }
273 273
274 @end 274 @end
275 275
276 enum FeatureToAnimate { 276 enum FeatureToAnimate {
277 ThumbAlpha, 277 ThumbAlpha,
278 TrackAlpha, 278 TrackAlpha,
279 UIStateTransition, 279 UIStateTransition,
280 ExpansionTransition 280 ExpansionTransition
281 }; 281 }
282 ;
282 283
283 @class BlinkScrollbarPartAnimation; 284 @class BlinkScrollbarPartAnimation;
284 285
285 namespace blink { 286 namespace blink {
286 287
287 // This class is used to drive the animation timer for 288 // This class is used to drive the animation timer for
288 // BlinkScrollbarPartAnimation 289 // BlinkScrollbarPartAnimation
289 // objects. This is used instead of NSAnimation because CoreAnimation 290 // objects. This is used instead of NSAnimation because CoreAnimation
290 // establishes connections to the WindowServer, which should not be done in a 291 // establishes connections to the WindowServer, which should not be done in a
291 // sandboxed renderer process. 292 // sandboxed renderer process.
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 } 650 }
650 651
651 - (void)scrollerImp:(id)scrollerImp 652 - (void)scrollerImp:(id)scrollerImp
652 overlayScrollerStateChangedTo:(NSUInteger)newOverlayScrollerState { 653 overlayScrollerStateChangedTo:(NSUInteger)newOverlayScrollerState {
653 // The names of these states are based on their observed behavior, and are not 654 // The names of these states are based on their observed behavior, and are not
654 // based on documentation. 655 // based on documentation.
655 enum { 656 enum {
656 NSScrollerStateInvisible = 0, 657 NSScrollerStateInvisible = 0,
657 NSScrollerStateKnob = 1, 658 NSScrollerStateKnob = 1,
658 NSScrollerStateExpanded = 2 659 NSScrollerStateExpanded = 2
659 }; 660 }
661 ;
660 // We do not receive notifications about the thumb un-expanding when the 662 // We do not receive notifications about the thumb un-expanding when the
661 // scrollbar fades away. Ensure 663 // scrollbar fades away. Ensure
662 // that we re-paint the thumb the next time that we transition away from being 664 // that we re-paint the thumb the next time that we transition away from being
663 // invisible, so that 665 // invisible, so that
664 // the thumb doesn't stick in an expanded state. 666 // the thumb doesn't stick in an expanded state.
665 if (newOverlayScrollerState == NSScrollerStateExpanded) { 667 if (newOverlayScrollerState == NSScrollerStateExpanded) {
666 _hasExpandedSinceInvisible = YES; 668 _hasExpandedSinceInvisible = YES;
667 } else if (newOverlayScrollerState != NSScrollerStateInvisible && 669 } else if (newOverlayScrollerState != NSScrollerStateInvisible &&
668 _hasExpandedSinceInvisible) { 670 _hasExpandedSinceInvisible) {
669 _scrollbar->setNeedsPaintInvalidation(ThumbPart); 671 _scrollbar->setNeedsPaintInvalidation(ThumbPart);
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 // a relayout will happen on its own. Otherwise, we must initiate a re-layout 1018 // a relayout will happen on its own. Otherwise, we must initiate a re-layout
1017 // ourselves. 1019 // ourselves.
1018 if (!m_needsScrollerStyleUpdate) 1020 if (!m_needsScrollerStyleUpdate)
1019 getScrollableArea()->scrollbarStyleChanged(); 1021 getScrollableArea()->scrollbarStyleChanged();
1020 1022
1021 m_needsScrollerStyleUpdate = false; 1023 m_needsScrollerStyleUpdate = false;
1022 } 1024 }
1023 1025
1024 void ScrollAnimatorMac::startScrollbarPaintTimer() { 1026 void ScrollAnimatorMac::startScrollbarPaintTimer() {
1025 m_initialScrollbarPaintTaskHandle = m_taskRunner->postCancellableTask( 1027 m_initialScrollbarPaintTaskHandle = m_taskRunner->postCancellableTask(
1026 BLINK_FROM_HERE, WTF::bind(&ScrollAnimatorMac::initialScrollbarPaintTask, 1028 BLINK_FROM_HERE,
1027 wrapWeakPersistent(this))); 1029 WTF::bind(&ScrollAnimatorMac::initialScrollbarPaintTask,
1030 wrapWeakPersistent(this)));
1028 } 1031 }
1029 1032
1030 bool ScrollAnimatorMac::scrollbarPaintTimerIsActive() const { 1033 bool ScrollAnimatorMac::scrollbarPaintTimerIsActive() const {
1031 return m_initialScrollbarPaintTaskHandle.isActive(); 1034 return m_initialScrollbarPaintTaskHandle.isActive();
1032 } 1035 }
1033 1036
1034 void ScrollAnimatorMac::stopScrollbarPaintTimer() { 1037 void ScrollAnimatorMac::stopScrollbarPaintTimer() {
1035 m_initialScrollbarPaintTaskHandle.cancel(); 1038 m_initialScrollbarPaintTaskHandle.cancel();
1036 } 1039 }
1037 1040
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 rectInViewCoordinates = 1077 rectInViewCoordinates =
1075 verticalScrollbar->convertToContainingWidget(scrollerThumb); 1078 verticalScrollbar->convertToContainingWidget(scrollerThumb);
1076 1079
1077 if (rectInViewCoordinates == m_visibleScrollerThumbRect) 1080 if (rectInViewCoordinates == m_visibleScrollerThumbRect)
1078 return; 1081 return;
1079 1082
1080 m_visibleScrollerThumbRect = rectInViewCoordinates; 1083 m_visibleScrollerThumbRect = rectInViewCoordinates;
1081 } 1084 }
1082 1085
1083 } // namespace blink 1086 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698