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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 DECLARE_VIRTUAL_TRACE(); | 68 DECLARE_VIRTUAL_TRACE(); |
69 | 69 |
70 private: | 70 private: |
71 // Inherited from ContextLifecycleObserver. | 71 // Inherited from ContextLifecycleObserver. |
72 void contextDestroyed(ExecutionContext*) override; | 72 void contextDestroyed(ExecutionContext*) override; |
73 | 73 |
74 // Inherited from PageVisibilityObserver. | 74 // Inherited from PageVisibilityObserver. |
75 void pageVisibilityChanged() override; | 75 void pageVisibilityChanged() override; |
76 | 76 |
77 // The VibrationManager mojo service. This is reset in |contextDestroyed| | 77 // Ptr to VibrationManager mojo interface. This is reset in |contextDestroyed| |
78 // and must not be called or recreated after it is reset. | 78 // and must not be called or recreated after it is reset. |
79 device::mojom::blink::VibrationManagerPtr m_service; | 79 device::mojom::blink::VibrationManagerPtr m_vibrationManager; |
80 | 80 |
81 // 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 |
82 // |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 |
83 // 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. |
84 TaskRunnerTimer<VibrationController> m_timerDoVibrate; | 84 TaskRunnerTimer<VibrationController> m_timerDoVibrate; |
85 | 85 |
86 // Whether a pattern is being processed. The vibration hardware may | 86 // Whether a pattern is being processed. The vibration hardware may |
87 // currently be active, or during a pause it may be inactive. | 87 // currently be active, or during a pause it may be inactive. |
88 bool m_isRunning; | 88 bool m_isRunning; |
89 | 89 |
90 // Whether an async mojo call to cancel is pending. | 90 // Whether an async mojo call to cancel is pending. |
91 bool m_isCallingCancel; | 91 bool m_isCallingCancel; |
92 | 92 |
93 // Whether an async mojo call to vibrate is pending. | 93 // Whether an async mojo call to vibrate is pending. |
94 bool m_isCallingVibrate; | 94 bool m_isCallingVibrate; |
95 | 95 |
96 VibrationPattern m_pattern; | 96 VibrationPattern m_pattern; |
97 }; | 97 }; |
98 | 98 |
99 } // namespace blink | 99 } // namespace blink |
100 | 100 |
101 #endif // VibrationController_h | 101 #endif // VibrationController_h |
OLD | NEW |