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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 // Whether a pattern is being processed. If this is true, the vibration | 62 // Whether a pattern is being processed. If this is true, the vibration |
63 // hardware may currently be active, but during a pause it may be inactive. | 63 // hardware may currently be active, but during a pause it may be inactive. |
64 bool isRunning() const { return m_isRunning; } | 64 bool isRunning() const { return m_isRunning; } |
65 | 65 |
66 VibrationPattern pattern() const { return m_pattern; } | 66 VibrationPattern pattern() const { return m_pattern; } |
67 | 67 |
68 DECLARE_VIRTUAL_TRACE(); | 68 DECLARE_VIRTUAL_TRACE(); |
69 | 69 |
70 private: | 70 private: |
71 // Inherited from ContextLifecycleObserver and PageVisibilityObserver. | 71 // Inherited from ContextLifecycleObserver. |
72 void contextDestroyed(ExecutionContext*) override; | 72 void contextDestroyed(ExecutionContext*) override; |
73 void contextDestroyed(Page*) override; | |
74 | 73 |
75 // Inherited from PageVisibilityObserver. | 74 // Inherited from PageVisibilityObserver. |
76 void pageVisibilityChanged() override; | 75 void pageVisibilityChanged() override; |
77 | 76 |
78 // The VibrationManager mojo service. This is reset in |contextDestroyed| | 77 // The VibrationManager mojo service. This is reset in |contextDestroyed| |
79 // and must not be called or recreated after it is reset. | 78 // and must not be called or recreated after it is reset. |
80 device::blink::VibrationManagerPtr m_service; | 79 device::blink::VibrationManagerPtr m_service; |
81 | 80 |
82 // Timer for calling |doVibrate| after a delay. It is safe to call | 81 // Timer for calling |doVibrate| after a delay. It is safe to call |
83 // |startOneshot| when the timer is already running: it may affect the time | 82 // |startOneshot| when the timer is already running: it may affect the time |
84 // at which it fires, but |doVibrate| will still be called only once. | 83 // at which it fires, but |doVibrate| will still be called only once. |
85 Timer<VibrationController> m_timerDoVibrate; | 84 Timer<VibrationController> m_timerDoVibrate; |
86 | 85 |
87 // Whether a pattern is being processed. The vibration hardware may | 86 // Whether a pattern is being processed. The vibration hardware may |
88 // currently be active, or during a pause it may be inactive. | 87 // currently be active, or during a pause it may be inactive. |
89 bool m_isRunning; | 88 bool m_isRunning; |
90 | 89 |
91 // Whether an async mojo call to cancel is pending. | 90 // Whether an async mojo call to cancel is pending. |
92 bool m_isCallingCancel; | 91 bool m_isCallingCancel; |
93 | 92 |
94 // Whether an async mojo call to vibrate is pending. | 93 // Whether an async mojo call to vibrate is pending. |
95 bool m_isCallingVibrate; | 94 bool m_isCallingVibrate; |
96 | 95 |
97 VibrationPattern m_pattern; | 96 VibrationPattern m_pattern; |
98 }; | 97 }; |
99 | 98 |
100 } // namespace blink | 99 } // namespace blink |
101 | 100 |
102 #endif // VibrationController_h | 101 #endif // VibrationController_h |
OLD | NEW |