Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(464)

Side by Side Diff: third_party/WebKit/Source/modules/vibration/NavigatorVibration.cpp

Issue 1846913009: HeapSupplements are now just Supplements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698