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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 m_pattern.remove(0); | 121 m_pattern.remove(0); |
122 } | 122 } |
123 } | 123 } |
124 | 124 |
125 void NavigatorVibration::pageVisibilityChanged() | 125 void NavigatorVibration::pageVisibilityChanged() |
126 { | 126 { |
127 if (page()->visibilityState() != PageVisibilityStateVisible) | 127 if (page()->visibilityState() != PageVisibilityStateVisible) |
128 cancelVibration(); | 128 cancelVibration(); |
129 } | 129 } |
130 | 130 |
| 131 void NavigatorVibration::didCommitLoad(Frame* frame) |
| 132 { |
| 133 // A new load has been committed, which means the current page will be |
| 134 // unloaded. Cancel all running vibrations. |
| 135 cancelVibration(); |
| 136 } |
| 137 |
131 bool NavigatorVibration::vibrate(Navigator* navigator, unsigned time) | 138 bool NavigatorVibration::vibrate(Navigator* navigator, unsigned time) |
132 { | 139 { |
133 VibrationPattern pattern; | 140 VibrationPattern pattern; |
134 pattern.append(time); | 141 pattern.append(time); |
135 return NavigatorVibration::vibrate(navigator, pattern); | 142 return NavigatorVibration::vibrate(navigator, pattern); |
136 } | 143 } |
137 | 144 |
138 bool NavigatorVibration::vibrate(Navigator* navigator, const VibrationPattern& p
attern) | 145 bool NavigatorVibration::vibrate(Navigator* navigator, const VibrationPattern& p
attern) |
139 { | 146 { |
140 Page* page = navigator->frame()->page(); | 147 Page* page = navigator->frame()->page(); |
(...skipping 15 matching lines...) Expand all Loading... |
156 } | 163 } |
157 return navigatorVibration; | 164 return navigatorVibration; |
158 } | 165 } |
159 | 166 |
160 const char* NavigatorVibration::supplementName() | 167 const char* NavigatorVibration::supplementName() |
161 { | 168 { |
162 return "NavigatorVibration"; | 169 return "NavigatorVibration"; |
163 } | 170 } |
164 | 171 |
165 } // namespace WebCore | 172 } // namespace WebCore |
OLD | NEW |