| 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/DeviceOrientationController.h" | 5 #include "modules/device_orientation/DeviceOrientationController.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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 document(), | 63 document(), |
| 64 HostsUsingFeatures::Feature::DeviceOrientationInsecureHost); | 64 HostsUsingFeatures::Feature::DeviceOrientationInsecureHost); |
| 65 if (document() | 65 if (document() |
| 66 .frame() | 66 .frame() |
| 67 ->settings() | 67 ->settings() |
| 68 ->getStrictPowerfulFeatureRestrictions()) | 68 ->getStrictPowerfulFeatureRestrictions()) |
| 69 return; | 69 return; |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 | 72 |
| 73 if (!m_hasEventListener) | 73 if (!m_hasEventListener) { |
| 74 Platform::current()->recordRapporURL("DeviceSensors.DeviceOrientation", | 74 Platform::current()->recordRapporURL("DeviceSensors.DeviceOrientation", |
| 75 WebURL(document().url())); | 75 WebURL(document().url())); |
| 76 | 76 |
| 77 if (!isSameSecurityOriginAsMainFrame()) { |
| 78 Platform::current()->recordRapporURL( |
| 79 "DeviceSensors.DeviceOrientationCrossOrigin", |
| 80 WebURL(document().url())); |
| 81 } |
| 82 } |
| 83 |
| 77 DeviceSingleWindowEventController::didAddEventListener(window, eventType); | 84 DeviceSingleWindowEventController::didAddEventListener(window, eventType); |
| 78 } | 85 } |
| 79 | 86 |
| 80 DeviceOrientationData* DeviceOrientationController::lastData() const { | 87 DeviceOrientationData* DeviceOrientationController::lastData() const { |
| 81 return m_overrideOrientationData | 88 return m_overrideOrientationData |
| 82 ? m_overrideOrientationData.get() | 89 ? m_overrideOrientationData.get() |
| 83 : dispatcherInstance().latestDeviceOrientationData(); | 90 : dispatcherInstance().latestDeviceOrientationData(); |
| 84 } | 91 } |
| 85 | 92 |
| 86 bool DeviceOrientationController::hasLastData() { | 93 bool DeviceOrientationController::hasLastData() { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 return DeviceOrientationDispatcher::instance(false); | 135 return DeviceOrientationDispatcher::instance(false); |
| 129 } | 136 } |
| 130 | 137 |
| 131 DEFINE_TRACE(DeviceOrientationController) { | 138 DEFINE_TRACE(DeviceOrientationController) { |
| 132 visitor->trace(m_overrideOrientationData); | 139 visitor->trace(m_overrideOrientationData); |
| 133 DeviceSingleWindowEventController::trace(visitor); | 140 DeviceSingleWindowEventController::trace(visitor); |
| 134 Supplement<Document>::trace(visitor); | 141 Supplement<Document>::trace(visitor); |
| 135 } | 142 } |
| 136 | 143 |
| 137 } // namespace blink | 144 } // namespace blink |
| OLD | NEW |