| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 return false; | 98 return false; |
| 99 } | 99 } |
| 100 | 100 |
| 101 return NavigatorVibration::from(navigator).controller(*frame)->vibrate( | 101 return NavigatorVibration::from(navigator).controller(*frame)->vibrate( |
| 102 pattern); | 102 pattern); |
| 103 } | 103 } |
| 104 | 104 |
| 105 // static | 105 // static |
| 106 void NavigatorVibration::collectHistogramMetrics(const LocalFrame& frame) { | 106 void NavigatorVibration::collectHistogramMetrics(const LocalFrame& frame) { |
| 107 NavigatorVibrationType type; | 107 NavigatorVibrationType type; |
| 108 bool userGesture = UserGestureIndicator::processingUserGesture(); | 108 bool userGesture = frame.hasReceivedUserGesture(); |
| 109 UseCounter::count(&frame, UseCounter::NavigatorVibrate); | 109 UseCounter::count(&frame, UseCounter::NavigatorVibrate); |
| 110 if (!frame.isMainFrame()) { | 110 if (!frame.isMainFrame()) { |
| 111 UseCounter::count(&frame, UseCounter::NavigatorVibrateSubFrame); | 111 UseCounter::count(&frame, UseCounter::NavigatorVibrateSubFrame); |
| 112 if (frame.isCrossOriginSubframe()) { | 112 if (frame.isCrossOriginSubframe()) { |
| 113 if (userGesture) | 113 if (userGesture) |
| 114 type = NavigatorVibrationType::CrossOriginSubFrameWithUserGesture; | 114 type = NavigatorVibrationType::CrossOriginSubFrameWithUserGesture; |
| 115 else | 115 else |
| 116 type = NavigatorVibrationType::CrossOriginSubFrameNoUserGesture; | 116 type = NavigatorVibrationType::CrossOriginSubFrameNoUserGesture; |
| 117 } else { | 117 } else { |
| 118 if (userGesture) | 118 if (userGesture) |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 } | 166 } |
| 167 } | 167 } |
| 168 | 168 |
| 169 DEFINE_TRACE(NavigatorVibration) { | 169 DEFINE_TRACE(NavigatorVibration) { |
| 170 visitor->trace(m_controller); | 170 visitor->trace(m_controller); |
| 171 Supplement<Navigator>::trace(visitor); | 171 Supplement<Navigator>::trace(visitor); |
| 172 ContextLifecycleObserver::trace(visitor); | 172 ContextLifecycleObserver::trace(visitor); |
| 173 } | 173 } |
| 174 | 174 |
| 175 } // namespace blink | 175 } // namespace blink |
| OLD | NEW |