| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/device_orientation/DeviceMotionController.h" | 5 #include "modules/device_orientation/DeviceMotionController.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/frame/Deprecation.h" | 8 #include "core/frame/Deprecation.h" |
| 9 #include "core/frame/HostsUsingFeatures.h" | 9 #include "core/frame/HostsUsingFeatures.h" |
| 10 #include "core/frame/Settings.h" | 10 #include "core/frame/Settings.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 if (document().frame()) { | 45 if (document().frame()) { |
| 46 if (document().isSecureContext()) { | 46 if (document().isSecureContext()) { |
| 47 UseCounter::count(document().frame(), | 47 UseCounter::count(document().frame(), |
| 48 UseCounter::DeviceMotionSecureOrigin); | 48 UseCounter::DeviceMotionSecureOrigin); |
| 49 } else { | 49 } else { |
| 50 Deprecation::countDeprecation(document().frame(), | 50 Deprecation::countDeprecation(document().frame(), |
| 51 UseCounter::DeviceMotionInsecureOrigin); | 51 UseCounter::DeviceMotionInsecureOrigin); |
| 52 HostsUsingFeatures::countAnyWorld( | 52 HostsUsingFeatures::countAnyWorld( |
| 53 document(), HostsUsingFeatures::Feature::DeviceMotionInsecureHost); | 53 document(), HostsUsingFeatures::Feature::DeviceMotionInsecureHost); |
| 54 if (document().frame()->settings()->strictPowerfulFeatureRestrictions()) | 54 if (document() |
| 55 .frame() |
| 56 ->settings() |
| 57 ->getStrictPowerfulFeatureRestrictions()) |
| 55 return; | 58 return; |
| 56 } | 59 } |
| 57 } | 60 } |
| 58 | 61 |
| 59 if (!m_hasEventListener) | 62 if (!m_hasEventListener) |
| 60 Platform::current()->recordRapporURL("DeviceSensors.DeviceMotion", | 63 Platform::current()->recordRapporURL("DeviceSensors.DeviceMotion", |
| 61 WebURL(document().url())); | 64 WebURL(document().url())); |
| 62 | 65 |
| 63 DeviceSingleWindowEventController::didAddEventListener(window, eventType); | 66 DeviceSingleWindowEventController::didAddEventListener(window, eventType); |
| 64 } | 67 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 89 const AtomicString& DeviceMotionController::eventTypeName() const { | 92 const AtomicString& DeviceMotionController::eventTypeName() const { |
| 90 return EventTypeNames::devicemotion; | 93 return EventTypeNames::devicemotion; |
| 91 } | 94 } |
| 92 | 95 |
| 93 DEFINE_TRACE(DeviceMotionController) { | 96 DEFINE_TRACE(DeviceMotionController) { |
| 94 DeviceSingleWindowEventController::trace(visitor); | 97 DeviceSingleWindowEventController::trace(visitor); |
| 95 Supplement<Document>::trace(visitor); | 98 Supplement<Document>::trace(visitor); |
| 96 } | 99 } |
| 97 | 100 |
| 98 } // namespace blink | 101 } // namespace blink |
| OLD | NEW |