| 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 "config.h" | 5 #include "config.h" |
| 6 #include "modules/device_orientation/DeviceOrientationController.h" | 6 #include "modules/device_orientation/DeviceOrientationController.h" |
| 7 | 7 |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/frame/OriginsUsingFeatures.h" | 9 #include "core/frame/OriginsUsingFeatures.h" |
| 10 #include "core/frame/Settings.h" | 10 #include "core/frame/Settings.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 return *controller; | 52 return *controller; |
| 53 } | 53 } |
| 54 | 54 |
| 55 void DeviceOrientationController::didAddEventListener(LocalDOMWindow* window, co
nst AtomicString& eventType) | 55 void DeviceOrientationController::didAddEventListener(LocalDOMWindow* window, co
nst AtomicString& eventType) |
| 56 { | 56 { |
| 57 if (eventType != eventTypeName()) | 57 if (eventType != eventTypeName()) |
| 58 return; | 58 return; |
| 59 | 59 |
| 60 if (document().frame()) { | 60 if (document().frame()) { |
| 61 String errorMessage; | 61 String errorMessage; |
| 62 if (document().isPrivilegedContext(errorMessage)) { | 62 if (document().isSecureContext(errorMessage)) { |
| 63 UseCounter::count(document().frame(), UseCounter::DeviceOrientationS
ecureOrigin); | 63 UseCounter::count(document().frame(), UseCounter::DeviceOrientationS
ecureOrigin); |
| 64 } else { | 64 } else { |
| 65 UseCounter::countDeprecation(document().frame(), UseCounter::DeviceO
rientationInsecureOrigin); | 65 UseCounter::countDeprecation(document().frame(), UseCounter::DeviceO
rientationInsecureOrigin); |
| 66 OriginsUsingFeatures::countAnyWorld(document(), OriginsUsingFeatures
::Feature::DeviceOrientationInsecureOrigin); | 66 OriginsUsingFeatures::countAnyWorld(document(), OriginsUsingFeatures
::Feature::DeviceOrientationInsecureOrigin); |
| 67 if (document().frame()->settings()->strictPowerfulFeatureRestriction
s()) | 67 if (document().frame()->settings()->strictPowerfulFeatureRestriction
s()) |
| 68 return; | 68 return; |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 | 71 |
| 72 if (!m_hasEventListener) | 72 if (!m_hasEventListener) |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 } | 128 } |
| 129 | 129 |
| 130 DEFINE_TRACE(DeviceOrientationController) | 130 DEFINE_TRACE(DeviceOrientationController) |
| 131 { | 131 { |
| 132 visitor->trace(m_overrideOrientationData); | 132 visitor->trace(m_overrideOrientationData); |
| 133 DeviceSingleWindowEventController::trace(visitor); | 133 DeviceSingleWindowEventController::trace(visitor); |
| 134 WillBeHeapSupplement<Document>::trace(visitor); | 134 WillBeHeapSupplement<Document>::trace(visitor); |
| 135 } | 135 } |
| 136 | 136 |
| 137 } // namespace blink | 137 } // namespace blink |
| OLD | NEW |