| 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 | 74 |
| 75 DCHECK(frame->document()); | 75 DCHECK(frame->document()); |
| 76 DCHECK(frame->page()); | 76 DCHECK(frame->page()); |
| 77 | 77 |
| 78 if (!frame->page()->isPageVisible()) | 78 if (!frame->page()->isPageVisible()) |
| 79 return false; | 79 return false; |
| 80 | 80 |
| 81 // TODO(lunalu): When FeaturePolicy is ready, take out the check for the | 81 // TODO(lunalu): When FeaturePolicy is ready, take out the check for the |
| 82 // runtime flag. Please pay attention to the user gesture code below. | 82 // runtime flag. Please pay attention to the user gesture code below. |
| 83 if (RuntimeEnabledFeatures::featurePolicyEnabled() && | 83 if (RuntimeEnabledFeatures::featurePolicyEnabled() && |
| 84 RuntimeEnabledFeatures::featurePolicyExperimentalFeaturesEnabled() && |
| 84 !frame->isFeatureEnabled(blink::WebFeaturePolicyFeature::Vibrate)) { | 85 !frame->isFeatureEnabled(blink::WebFeaturePolicyFeature::Vibrate)) { |
| 85 frame->domWindow()->printErrorMessage( | 86 frame->domWindow()->printErrorMessage( |
| 86 "Navigator.vibrate() is not enabled in feature policy for this " | 87 "Navigator.vibrate() is not enabled in feature policy for this " |
| 87 "frame."); | 88 "frame."); |
| 88 return false; | 89 return false; |
| 89 } | 90 } |
| 90 | 91 |
| 91 if (!RuntimeEnabledFeatures::featurePolicyEnabled() && | 92 if (!RuntimeEnabledFeatures::featurePolicyEnabled() && |
| 92 frame->isCrossOriginSubframe() && !frame->hasReceivedUserGesture()) { | 93 frame->isCrossOriginSubframe() && !frame->hasReceivedUserGesture()) { |
| 93 frame->domWindow()->printErrorMessage( | 94 frame->domWindow()->printErrorMessage( |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 } | 166 } |
| 166 } | 167 } |
| 167 | 168 |
| 168 DEFINE_TRACE(NavigatorVibration) { | 169 DEFINE_TRACE(NavigatorVibration) { |
| 169 visitor->trace(m_controller); | 170 visitor->trace(m_controller); |
| 170 Supplement<Navigator>::trace(visitor); | 171 Supplement<Navigator>::trace(visitor); |
| 171 ContextLifecycleObserver::trace(visitor); | 172 ContextLifecycleObserver::trace(visitor); |
| 172 } | 173 } |
| 173 | 174 |
| 174 } // namespace blink | 175 } // namespace blink |
| OLD | NEW |