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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 return false; | 150 return false; |
151 | 151 |
152 if (page->visibilityState() != PageVisibilityStateVisible) | 152 if (page->visibilityState() != PageVisibilityStateVisible) |
153 return false; | 153 return false; |
154 | 154 |
155 return NavigatorVibration::from(*page).vibrate(pattern); | 155 return NavigatorVibration::from(*page).vibrate(pattern); |
156 } | 156 } |
157 | 157 |
158 NavigatorVibration& NavigatorVibration::from(Page& page) | 158 NavigatorVibration& NavigatorVibration::from(Page& page) |
159 { | 159 { |
160 NavigatorVibration* navigatorVibration = static_cast<NavigatorVibration*>(Su
pplement<Page>::from(page, supplementName())); | 160 NavigatorVibration* navigatorVibration = static_cast<NavigatorVibration*>(Wi
llBeHeapSupplement<Page>::from(page, supplementName())); |
161 if (!navigatorVibration) { | 161 if (!navigatorVibration) { |
162 navigatorVibration = new NavigatorVibration(page); | 162 navigatorVibration = new NavigatorVibration(page); |
163 Supplement<Page>::provideTo(page, supplementName(), adoptPtr(navigatorVi
bration)); | 163 WillBeHeapSupplement<Page>::provideTo(page, supplementName(), adoptPtrWi
llBeNoop(navigatorVibration)); |
164 } | 164 } |
165 return *navigatorVibration; | 165 return *navigatorVibration; |
166 } | 166 } |
167 | 167 |
168 const char* NavigatorVibration::supplementName() | 168 const char* NavigatorVibration::supplementName() |
169 { | 169 { |
170 return "NavigatorVibration"; | 170 return "NavigatorVibration"; |
171 } | 171 } |
172 | 172 |
173 } // namespace WebCore | 173 } // namespace WebCore |
OLD | NEW |