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