| 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 : Supplement<Navigator>(navigator), | 37 : ContextLifecycleObserver(navigator.frame()->document()) {} |
| 38 ContextLifecycleObserver(navigator.frame() ? navigator.frame()->document() | |
| 39 : nullptr) {} | |
| 40 | 38 |
| 41 NavigatorVibration::~NavigatorVibration() {} | 39 NavigatorVibration::~NavigatorVibration() {} |
| 42 | 40 |
| 43 // static | 41 // static |
| 44 NavigatorVibration& NavigatorVibration::from(Navigator& navigator) { | 42 NavigatorVibration& NavigatorVibration::from(Navigator& navigator) { |
| 45 NavigatorVibration* navigatorVibration = static_cast<NavigatorVibration*>( | 43 NavigatorVibration* navigatorVibration = static_cast<NavigatorVibration*>( |
| 46 Supplement<Navigator>::from(navigator, supplementName())); | 44 Supplement<Navigator>::from(navigator, supplementName())); |
| 47 if (!navigatorVibration) { | 45 if (!navigatorVibration) { |
| 48 navigatorVibration = new NavigatorVibration(navigator); | 46 navigatorVibration = new NavigatorVibration(navigator); |
| 49 Supplement<Navigator>::provideTo(navigator, supplementName(), | 47 Supplement<Navigator>::provideTo(navigator, supplementName(), |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 } | 162 } |
| 165 } | 163 } |
| 166 | 164 |
| 167 DEFINE_TRACE(NavigatorVibration) { | 165 DEFINE_TRACE(NavigatorVibration) { |
| 168 visitor->trace(m_controller); | 166 visitor->trace(m_controller); |
| 169 Supplement<Navigator>::trace(visitor); | 167 Supplement<Navigator>::trace(visitor); |
| 170 ContextLifecycleObserver::trace(visitor); | 168 ContextLifecycleObserver::trace(visitor); |
| 171 } | 169 } |
| 172 | 170 |
| 173 } // namespace blink | 171 } // namespace blink |
| OLD | NEW |