| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 if (m_pattern.isEmpty()) | 120 if (m_pattern.isEmpty()) |
| 121 m_isRunning = false; | 121 m_isRunning = false; |
| 122 | 122 |
| 123 if (!m_isRunning || m_isCallingCancel || m_isCallingVibrate || | 123 if (!m_isRunning || m_isCallingCancel || m_isCallingVibrate || |
| 124 !getExecutionContext() || !page()->isPageVisible()) | 124 !getExecutionContext() || !page()->isPageVisible()) |
| 125 return; | 125 return; |
| 126 | 126 |
| 127 if (m_service) { | 127 if (m_service) { |
| 128 m_isCallingVibrate = true; | 128 m_isCallingVibrate = true; |
| 129 m_service->Vibrate(m_pattern[0], convertToBaseCallback(WTF::bind( | 129 m_service->Vibrate( |
| 130 &VibrationController::didVibrate, | 130 m_pattern[0], |
| 131 wrapPersistent(this)))); | 131 convertToBaseCallback( |
| 132 WTF::bind(&VibrationController::didVibrate, wrapPersistent(this)))); |
| 132 } | 133 } |
| 133 } | 134 } |
| 134 | 135 |
| 135 void VibrationController::didVibrate() { | 136 void VibrationController::didVibrate() { |
| 136 m_isCallingVibrate = false; | 137 m_isCallingVibrate = false; |
| 137 | 138 |
| 138 // If the pattern is empty here, it was probably cleared by a fresh call to | 139 // If the pattern is empty here, it was probably cleared by a fresh call to |
| 139 // |vibrate| while the mojo call was in flight. | 140 // |vibrate| while the mojo call was in flight. |
| 140 if (m_pattern.isEmpty()) | 141 if (m_pattern.isEmpty()) |
| 141 return; | 142 return; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 if (!page()->isPageVisible()) | 187 if (!page()->isPageVisible()) |
| 187 cancel(); | 188 cancel(); |
| 188 } | 189 } |
| 189 | 190 |
| 190 DEFINE_TRACE(VibrationController) { | 191 DEFINE_TRACE(VibrationController) { |
| 191 ContextLifecycleObserver::trace(visitor); | 192 ContextLifecycleObserver::trace(visitor); |
| 192 PageVisibilityObserver::trace(visitor); | 193 PageVisibilityObserver::trace(visitor); |
| 193 } | 194 } |
| 194 | 195 |
| 195 } // namespace blink | 196 } // namespace blink |
| OLD | NEW |