| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 return *controller; | 45 return *controller; |
| 46 } | 46 } |
| 47 | 47 |
| 48 void DeviceOrientationController::didAddEventListener( | 48 void DeviceOrientationController::didAddEventListener( |
| 49 LocalDOMWindow* window, | 49 LocalDOMWindow* window, |
| 50 const AtomicString& eventType) { | 50 const AtomicString& eventType) { |
| 51 if (eventType != eventTypeName()) | 51 if (eventType != eventTypeName()) |
| 52 return; | 52 return; |
| 53 | 53 |
| 54 if (document().frame()) { | 54 if (document().frame()) { |
| 55 String errorMessage; | 55 if (document().isSecureContext()) { |
| 56 if (document().isSecureContext(errorMessage)) { | |
| 57 UseCounter::count(document().frame(), | 56 UseCounter::count(document().frame(), |
| 58 UseCounter::DeviceOrientationSecureOrigin); | 57 UseCounter::DeviceOrientationSecureOrigin); |
| 59 } else { | 58 } else { |
| 60 Deprecation::countDeprecation( | 59 Deprecation::countDeprecation( |
| 61 document().frame(), UseCounter::DeviceOrientationInsecureOrigin); | 60 document().frame(), UseCounter::DeviceOrientationInsecureOrigin); |
| 62 HostsUsingFeatures::countAnyWorld( | 61 HostsUsingFeatures::countAnyWorld( |
| 63 document(), | 62 document(), |
| 64 HostsUsingFeatures::Feature::DeviceOrientationInsecureHost); | 63 HostsUsingFeatures::Feature::DeviceOrientationInsecureHost); |
| 65 if (document().frame()->settings()->strictPowerfulFeatureRestrictions()) | 64 if (document().frame()->settings()->strictPowerfulFeatureRestrictions()) |
| 66 return; | 65 return; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 return DeviceOrientationDispatcher::instance(false); | 124 return DeviceOrientationDispatcher::instance(false); |
| 126 } | 125 } |
| 127 | 126 |
| 128 DEFINE_TRACE(DeviceOrientationController) { | 127 DEFINE_TRACE(DeviceOrientationController) { |
| 129 visitor->trace(m_overrideOrientationData); | 128 visitor->trace(m_overrideOrientationData); |
| 130 DeviceSingleWindowEventController::trace(visitor); | 129 DeviceSingleWindowEventController::trace(visitor); |
| 131 Supplement<Document>::trace(visitor); | 130 Supplement<Document>::trace(visitor); |
| 132 } | 131 } |
| 133 | 132 |
| 134 } // namespace blink | 133 } // namespace blink |
| OLD | NEW |