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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 return false; | 177 return false; |
178 | 178 |
179 if (!page->isPageVisible()) | 179 if (!page->isPageVisible()) |
180 return false; | 180 return false; |
181 | 181 |
182 return NavigatorVibration::from(*page).vibrate(pattern); | 182 return NavigatorVibration::from(*page).vibrate(pattern); |
183 } | 183 } |
184 | 184 |
185 NavigatorVibration& NavigatorVibration::from(Page& page) | 185 NavigatorVibration& NavigatorVibration::from(Page& page) |
186 { | 186 { |
187 NavigatorVibration* navigatorVibration = static_cast<NavigatorVibration*>(He
apSupplement<Page>::from(page, supplementName())); | 187 NavigatorVibration* navigatorVibration = static_cast<NavigatorVibration*>(Su
pplement<Page>::from(page, supplementName())); |
188 if (!navigatorVibration) { | 188 if (!navigatorVibration) { |
189 navigatorVibration = new NavigatorVibration(page); | 189 navigatorVibration = new NavigatorVibration(page); |
190 HeapSupplement<Page>::provideTo(page, supplementName(), navigatorVibrati
on); | 190 Supplement<Page>::provideTo(page, supplementName(), navigatorVibration); |
191 } | 191 } |
192 return *navigatorVibration; | 192 return *navigatorVibration; |
193 } | 193 } |
194 | 194 |
195 const char* NavigatorVibration::supplementName() | 195 const char* NavigatorVibration::supplementName() |
196 { | 196 { |
197 return "NavigatorVibration"; | 197 return "NavigatorVibration"; |
198 } | 198 } |
199 | 199 |
200 DEFINE_TRACE(NavigatorVibration) | 200 DEFINE_TRACE(NavigatorVibration) |
201 { | 201 { |
202 HeapSupplement<Page>::trace(visitor); | 202 Supplement<Page>::trace(visitor); |
203 PageLifecycleObserver::trace(visitor); | 203 PageLifecycleObserver::trace(visitor); |
204 } | 204 } |
205 | 205 |
206 } // namespace blink | 206 } // namespace blink |
OLD | NEW |