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

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

Issue 2191533003: Refactor Timer classes in preparation for landing FrameTimers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More build fixes Created 4 years, 4 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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 { 323 {
324 m_timer.stop(); 324 m_timer.stop();
325 } 325 }
326 326
327 void setDuration(CFTimeInterval duration) 327 void setDuration(CFTimeInterval duration)
328 { 328 {
329 m_duration = duration; 329 m_duration = duration;
330 } 330 }
331 331
332 private: 332 private:
333 void timerFired(Timer<BlinkScrollbarPartAnimationTimer>*) 333 void timerFired(TimerBase*)
334 { 334 {
335 double currentTime = WTF::currentTime(); 335 double currentTime = WTF::currentTime();
336 double delta = currentTime - m_startTime; 336 double delta = currentTime - m_startTime;
337 337
338 if (delta >= m_duration) 338 if (delta >= m_duration)
339 m_timer.stop(); 339 m_timer.stop();
340 340
341 double fraction = delta / m_duration; 341 double fraction = delta / m_duration;
342 fraction = clampTo(fraction, 0.0, 1.0); 342 fraction = clampTo(fraction, 0.0, 1.0);
343 double progress = m_timingFunction->evaluate(fraction, 0.001); 343 double progress = m_timingFunction->evaluate(fraction, 0.001);
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
1101 if (Scrollbar* verticalScrollbar = m_scrollableArea->verticalScrollbar()) 1101 if (Scrollbar* verticalScrollbar = m_scrollableArea->verticalScrollbar())
1102 rectInViewCoordinates = verticalScrollbar->convertToContainingWidget(scr ollerThumb); 1102 rectInViewCoordinates = verticalScrollbar->convertToContainingWidget(scr ollerThumb);
1103 1103
1104 if (rectInViewCoordinates == m_visibleScrollerThumbRect) 1104 if (rectInViewCoordinates == m_visibleScrollerThumbRect)
1105 return; 1105 return;
1106 1106
1107 m_visibleScrollerThumbRect = rectInViewCoordinates; 1107 m_visibleScrollerThumbRect = rectInViewCoordinates;
1108 } 1108 }
1109 1109
1110 } // namespace blink 1110 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/BitmapImage.cpp ('k') | third_party/WebKit/Source/platform/scroll/Scrollbar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698