| 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 16 matching lines...) Expand all Loading... |
| 27 #include "core/frame/UseCounter.h" | 27 #include "core/frame/UseCounter.h" |
| 28 #include "core/page/Page.h" | 28 #include "core/page/Page.h" |
| 29 #include "modules/vibration/VibrationController.h" | 29 #include "modules/vibration/VibrationController.h" |
| 30 #include "platform/Histogram.h" | 30 #include "platform/Histogram.h" |
| 31 #include "platform/UserGestureIndicator.h" | 31 #include "platform/UserGestureIndicator.h" |
| 32 #include "public/platform/site_engagement.mojom-blink.h" | 32 #include "public/platform/site_engagement.mojom-blink.h" |
| 33 | 33 |
| 34 namespace blink { | 34 namespace blink { |
| 35 | 35 |
| 36 NavigatorVibration::NavigatorVibration(Navigator& navigator) | 36 NavigatorVibration::NavigatorVibration(Navigator& navigator) |
| 37 : ContextLifecycleObserver(navigator.frame()->document()) {} | 37 : Supplement<Navigator>(navigator), |
| 38 ContextLifecycleObserver(navigator.frame() ? navigator.frame()->document() |
| 39 : nullptr) {} |
| 38 | 40 |
| 39 NavigatorVibration::~NavigatorVibration() {} | 41 NavigatorVibration::~NavigatorVibration() {} |
| 40 | 42 |
| 41 // static | 43 // static |
| 42 NavigatorVibration& NavigatorVibration::from(Navigator& navigator) { | 44 NavigatorVibration& NavigatorVibration::from(Navigator& navigator) { |
| 43 NavigatorVibration* navigatorVibration = static_cast<NavigatorVibration*>( | 45 NavigatorVibration* navigatorVibration = static_cast<NavigatorVibration*>( |
| 44 Supplement<Navigator>::from(navigator, supplementName())); | 46 Supplement<Navigator>::from(navigator, supplementName())); |
| 45 if (!navigatorVibration) { | 47 if (!navigatorVibration) { |
| 46 navigatorVibration = new NavigatorVibration(navigator); | 48 navigatorVibration = new NavigatorVibration(navigator); |
| 47 Supplement<Navigator>::provideTo(navigator, supplementName(), | 49 Supplement<Navigator>::provideTo(navigator, supplementName(), |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 } | 164 } |
| 163 } | 165 } |
| 164 | 166 |
| 165 DEFINE_TRACE(NavigatorVibration) { | 167 DEFINE_TRACE(NavigatorVibration) { |
| 166 visitor->trace(m_controller); | 168 visitor->trace(m_controller); |
| 167 Supplement<Navigator>::trace(visitor); | 169 Supplement<Navigator>::trace(visitor); |
| 168 ContextLifecycleObserver::trace(visitor); | 170 ContextLifecycleObserver::trace(visitor); |
| 169 } | 171 } |
| 170 | 172 |
| 171 } // namespace blink | 173 } // namespace blink |
| OLD | NEW |