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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 typedef Vector<unsigned> VibrationPattern; | 42 typedef Vector<unsigned> VibrationPattern; |
43 | 43 |
44 virtual ~NavigatorVibration(); | 44 virtual ~NavigatorVibration(); |
45 | 45 |
46 bool vibrate(const VibrationPattern&); | 46 bool vibrate(const VibrationPattern&); |
47 void cancelVibration(); | 47 void cancelVibration(); |
48 void timerStartFired(Timer<NavigatorVibration>*); | 48 void timerStartFired(Timer<NavigatorVibration>*); |
49 void timerStopFired(Timer<NavigatorVibration>*); | 49 void timerStopFired(Timer<NavigatorVibration>*); |
50 | 50 |
51 // Inherited from PageLifecycleObserver | 51 // Inherited from PageLifecycleObserver |
52 virtual void pageVisibilityChanged() override; | 52 void pageVisibilityChanged() override; |
53 virtual void didCommitLoad(LocalFrame*) override; | 53 void didCommitLoad(LocalFrame*) override; |
54 | 54 |
55 static bool vibrate(Navigator&, unsigned time); | 55 static bool vibrate(Navigator&, unsigned time); |
56 static bool vibrate(Navigator&, const VibrationPattern&); | 56 static bool vibrate(Navigator&, const VibrationPattern&); |
57 static NavigatorVibration& from(Page&); | 57 static NavigatorVibration& from(Page&); |
58 static VibrationPattern sanitizeVibrationPattern(const UnsignedLongOrUnsigne
dLongSequence&); | 58 static VibrationPattern sanitizeVibrationPattern(const UnsignedLongOrUnsigne
dLongSequence&); |
59 | 59 |
60 bool isVibrating() const { return m_isVibrating; } | 60 bool isVibrating() const { return m_isVibrating; } |
61 | 61 |
62 VibrationPattern pattern() const { return m_pattern; } | 62 VibrationPattern pattern() const { return m_pattern; } |
63 | 63 |
64 DECLARE_VIRTUAL_TRACE(); | 64 DECLARE_VIRTUAL_TRACE(); |
65 | 65 |
66 private: | 66 private: |
67 explicit NavigatorVibration(Page&); | 67 explicit NavigatorVibration(Page&); |
68 static const char* supplementName(); | 68 static const char* supplementName(); |
69 | 69 |
70 Timer<NavigatorVibration> m_timerStart; | 70 Timer<NavigatorVibration> m_timerStart; |
71 Timer<NavigatorVibration> m_timerStop; | 71 Timer<NavigatorVibration> m_timerStop; |
72 bool m_isVibrating; | 72 bool m_isVibrating; |
73 VibrationPattern m_pattern; | 73 VibrationPattern m_pattern; |
74 }; | 74 }; |
75 | 75 |
76 } // namespace blink | 76 } // namespace blink |
77 | 77 |
78 #endif // NavigatorVibration_h | 78 #endif // NavigatorVibration_h |
OLD | NEW |