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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 } | 74 } |
75 | 75 |
76 VibrationController::VibrationController(Document& document) | 76 VibrationController::VibrationController(Document& document) |
77 : ContextLifecycleObserver(&document), | 77 : ContextLifecycleObserver(&document), |
78 PageVisibilityObserver(document.page()), | 78 PageVisibilityObserver(document.page()), |
79 m_timerDoVibrate(this, &VibrationController::doVibrate), | 79 m_timerDoVibrate(this, &VibrationController::doVibrate), |
80 m_isRunning(false), | 80 m_isRunning(false), |
81 m_isCallingCancel(false), | 81 m_isCallingCancel(false), |
82 m_isCallingVibrate(false) { | 82 m_isCallingVibrate(false) { |
83 document.frame()->interfaceProvider()->getInterface( | 83 document.frame()->interfaceProvider()->getInterface( |
84 mojo::GetProxy(&m_service)); | 84 mojo::MakeRequest(&m_service)); |
85 } | 85 } |
86 | 86 |
87 VibrationController::~VibrationController() {} | 87 VibrationController::~VibrationController() {} |
88 | 88 |
89 bool VibrationController::vibrate(const VibrationPattern& pattern) { | 89 bool VibrationController::vibrate(const VibrationPattern& pattern) { |
90 // Cancel clears the stored pattern and cancels any ongoing vibration. | 90 // Cancel clears the stored pattern and cancels any ongoing vibration. |
91 cancel(); | 91 cancel(); |
92 | 92 |
93 m_pattern = sanitizeVibrationPatternInternal(pattern); | 93 m_pattern = sanitizeVibrationPatternInternal(pattern); |
94 | 94 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 if (!page()->isPageVisible()) | 183 if (!page()->isPageVisible()) |
184 cancel(); | 184 cancel(); |
185 } | 185 } |
186 | 186 |
187 DEFINE_TRACE(VibrationController) { | 187 DEFINE_TRACE(VibrationController) { |
188 ContextLifecycleObserver::trace(visitor); | 188 ContextLifecycleObserver::trace(visitor); |
189 PageVisibilityObserver::trace(visitor); | 189 PageVisibilityObserver::trace(visitor); |
190 } | 190 } |
191 | 191 |
192 } // namespace blink | 192 } // namespace blink |
OLD | NEW |