| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 collectHistogramMetrics(*frame); | 74 collectHistogramMetrics(*frame); |
| 75 | 75 |
| 76 DCHECK(frame->document()); | 76 DCHECK(frame->document()); |
| 77 DCHECK(frame->page()); | 77 DCHECK(frame->page()); |
| 78 | 78 |
| 79 if (!frame->page()->isPageVisible()) | 79 if (!frame->page()->isPageVisible()) |
| 80 return false; | 80 return false; |
| 81 | 81 |
| 82 // TODO(lunalu): When FeaturePolicy is ready, take out the check for the | 82 // TODO(lunalu): When FeaturePolicy is ready, take out the check for the |
| 83 // runtime flag. | 83 // runtime flag. |
| 84 if (!isFeatureEnabledInFrame(blink::kVibrateFeature, frame)) { | 84 if (!isFeatureEnabledInFrame(blink::WebFeaturePolicyFeature::Vibrate, |
| 85 frame)) { |
| 85 if (RuntimeEnabledFeatures::featurePolicyEnabled()) { | 86 if (RuntimeEnabledFeatures::featurePolicyEnabled()) { |
| 86 frame->domWindow()->printErrorMessage( | 87 frame->domWindow()->printErrorMessage( |
| 87 "Navigator.vibrate() is not enabled in feature policy for this " | 88 "Navigator.vibrate() is not enabled in feature policy for this " |
| 88 "frame."); | 89 "frame."); |
| 89 } else { | 90 } else { |
| 90 frame->domWindow()->printErrorMessage( | 91 frame->domWindow()->printErrorMessage( |
| 91 "A call of navigator.vibrate will be no-op inside cross-origin " | 92 "A call of navigator.vibrate will be no-op inside cross-origin " |
| 92 "iframes: https://www.chromestatus.com/feature/5682658461876224."); | 93 "iframes: https://www.chromestatus.com/feature/5682658461876224."); |
| 93 } | 94 } |
| 94 return false; | 95 return false; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 } | 163 } |
| 163 } | 164 } |
| 164 | 165 |
| 165 DEFINE_TRACE(NavigatorVibration) { | 166 DEFINE_TRACE(NavigatorVibration) { |
| 166 visitor->trace(m_controller); | 167 visitor->trace(m_controller); |
| 167 Supplement<Navigator>::trace(visitor); | 168 Supplement<Navigator>::trace(visitor); |
| 168 ContextLifecycleObserver::trace(visitor); | 169 ContextLifecycleObserver::trace(visitor); |
| 169 } | 170 } |
| 170 | 171 |
| 171 } // namespace blink | 172 } // namespace blink |
| OLD | NEW |