| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 HostsUsingFeatures::countAnyWorld( | 53 HostsUsingFeatures::countAnyWorld( |
| 54 document(), HostsUsingFeatures::Feature::DeviceMotionInsecureHost); | 54 document(), HostsUsingFeatures::Feature::DeviceMotionInsecureHost); |
| 55 if (document() | 55 if (document() |
| 56 .frame() | 56 .frame() |
| 57 ->settings() | 57 ->settings() |
| 58 ->getStrictPowerfulFeatureRestrictions()) | 58 ->getStrictPowerfulFeatureRestrictions()) |
| 59 return; | 59 return; |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 | 62 |
| 63 if (!m_hasEventListener) | 63 if (!m_hasEventListener) { |
| 64 Platform::current()->recordRapporURL("DeviceSensors.DeviceMotion", | 64 Platform::current()->recordRapporURL("DeviceSensors.DeviceMotion", |
| 65 WebURL(document().url())); | 65 WebURL(document().url())); |
| 66 | 66 |
| 67 if (!isSameSecurityOriginAsMainFrame()) { |
| 68 Platform::current()->recordRapporURL( |
| 69 "DeviceSensors.DeviceMotionCrossOrigin", WebURL(document().url())); |
| 70 } |
| 71 } |
| 72 |
| 67 DeviceSingleWindowEventController::didAddEventListener(window, eventType); | 73 DeviceSingleWindowEventController::didAddEventListener(window, eventType); |
| 68 } | 74 } |
| 69 | 75 |
| 70 bool DeviceMotionController::hasLastData() { | 76 bool DeviceMotionController::hasLastData() { |
| 71 return DeviceMotionDispatcher::instance().latestDeviceMotionData(); | 77 return DeviceMotionDispatcher::instance().latestDeviceMotionData(); |
| 72 } | 78 } |
| 73 | 79 |
| 74 void DeviceMotionController::registerWithDispatcher() { | 80 void DeviceMotionController::registerWithDispatcher() { |
| 75 DeviceMotionDispatcher::instance().addController(this); | 81 DeviceMotionDispatcher::instance().addController(this); |
| 76 } | 82 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 93 const AtomicString& DeviceMotionController::eventTypeName() const { | 99 const AtomicString& DeviceMotionController::eventTypeName() const { |
| 94 return EventTypeNames::devicemotion; | 100 return EventTypeNames::devicemotion; |
| 95 } | 101 } |
| 96 | 102 |
| 97 DEFINE_TRACE(DeviceMotionController) { | 103 DEFINE_TRACE(DeviceMotionController) { |
| 98 DeviceSingleWindowEventController::trace(visitor); | 104 DeviceSingleWindowEventController::trace(visitor); |
| 99 Supplement<Document>::trace(visitor); | 105 Supplement<Document>::trace(visitor); |
| 100 } | 106 } |
| 101 | 107 |
| 102 } // namespace blink | 108 } // namespace blink |
| OLD | NEW |