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

Side by Side Diff: third_party/WebKit/Source/core/html/shadow/SpinButtonElement.cpp

Issue 2191533003: Refactor Timer classes in preparation for landing FrameTimers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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) 2006, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2010 Google 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 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 // On Mac OS, NSStepper updates the value for the button under the mouse 227 // On Mac OS, NSStepper updates the value for the button under the mouse
228 // cursor regardless of the button pressed at the beginning. So the 228 // cursor regardless of the button pressed at the beginning. So the
229 // following check is not needed for Mac OS. 229 // following check is not needed for Mac OS.
230 #if !OS(MACOSX) 230 #if !OS(MACOSX)
231 if (m_upDownState != m_pressStartingState) 231 if (m_upDownState != m_pressStartingState)
232 return; 232 return;
233 #endif 233 #endif
234 doStepAction(amount); 234 doStepAction(amount);
235 } 235 }
236 236
237 void SpinButtonElement::repeatingTimerFired(Timer<SpinButtonElement>*) 237 void SpinButtonElement::repeatingTimerFired(TimerBase*)
238 { 238 {
239 if (m_upDownState != Indeterminate) 239 if (m_upDownState != Indeterminate)
240 step(m_upDownState == Up ? 1 : -1); 240 step(m_upDownState == Up ? 1 : -1);
241 } 241 }
242 242
243 void SpinButtonElement::setHovered(bool flag) 243 void SpinButtonElement::setHovered(bool flag)
244 { 244 {
245 if (!flag) 245 if (!flag)
246 m_upDownState = Indeterminate; 246 m_upDownState = Indeterminate;
247 HTMLDivElement::setHovered(flag); 247 HTMLDivElement::setHovered(flag);
248 } 248 }
249 249
250 bool SpinButtonElement::shouldRespondToMouseEvents() 250 bool SpinButtonElement::shouldRespondToMouseEvents()
251 { 251 {
252 return !m_spinButtonOwner || m_spinButtonOwner->shouldSpinButtonRespondToMou seEvents(); 252 return !m_spinButtonOwner || m_spinButtonOwner->shouldSpinButtonRespondToMou seEvents();
253 } 253 }
254 254
255 DEFINE_TRACE(SpinButtonElement) 255 DEFINE_TRACE(SpinButtonElement)
256 { 256 {
257 visitor->trace(m_spinButtonOwner); 257 visitor->trace(m_spinButtonOwner);
258 HTMLDivElement::trace(visitor); 258 HTMLDivElement::trace(visitor);
259 } 259 }
260 260
261 } // namespace blink 261 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698