| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Samsung Electronics | 2 * Copyright (C) 2012 Samsung Electronics |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 namespace WebCore { | 28 namespace WebCore { |
| 29 | 29 |
| 30 class NavigatorVibration : public Supplement<Navigator> { | 30 class NavigatorVibration : public Supplement<Navigator> { |
| 31 public: | 31 public: |
| 32 typedef Vector<unsigned> VibrationPattern; | 32 typedef Vector<unsigned> VibrationPattern; |
| 33 | 33 |
| 34 ~NavigatorVibration(); | 34 ~NavigatorVibration(); |
| 35 | 35 |
| 36 bool vibrate(const VibrationPattern&); | 36 bool vibrate(const VibrationPattern&); |
| 37 void cancelVibration(); | 37 void cancelVibration(); |
| 38 |
| 38 // FIXME : Hook suspendVibration() and resumeVibration() into the page | 39 // FIXME : Hook suspendVibration() and resumeVibration() into the page |
| 39 // visibility feature, when the document.hidden attribute is changed. | 40 // visibility feature, when the document.hidden attribute is changed. |
| 40 void suspendVibration(); | 41 void suspendVibration(); |
| 41 void resumeVibration(); | 42 void resumeVibration(); |
| 43 |
| 42 void timerStartFired(Timer<NavigatorVibration>*); | 44 void timerStartFired(Timer<NavigatorVibration>*); |
| 43 void timerStopFired(Timer<NavigatorVibration>*); | 45 void timerStopFired(Timer<NavigatorVibration>*); |
| 44 | 46 |
| 45 static bool vibrate(Navigator*, unsigned time); | 47 static bool vibrate(Navigator*, unsigned time); |
| 46 static bool vibrate(Navigator*, const VibrationPattern&); | 48 static bool vibrate(Navigator*, const VibrationPattern&); |
| 47 static NavigatorVibration* from(Navigator*); | 49 static NavigatorVibration* from(Navigator*); |
| 48 | 50 |
| 51 bool isVibrating() { return m_isVibrating; } |
| 52 |
| 49 private: | 53 private: |
| 50 NavigatorVibration(); | 54 NavigatorVibration(); |
| 51 static const char* supplementName(); | 55 static const char* supplementName(); |
| 52 | 56 |
| 53 Timer<NavigatorVibration> m_timerStart; | 57 Timer<NavigatorVibration> m_timerStart; |
| 54 Timer<NavigatorVibration> m_timerStop; | 58 Timer<NavigatorVibration> m_timerStop; |
| 55 bool m_isVibrating; | 59 bool m_isVibrating; |
| 56 VibrationPattern m_pattern; | 60 VibrationPattern m_pattern; |
| 57 }; | 61 }; |
| 58 | 62 |
| 59 } // namespace WebCore | 63 } // namespace WebCore |
| 60 | 64 |
| 61 #endif // NavigatorVibration_h | 65 #endif // NavigatorVibration_h |
| OLD | NEW |