| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/DeviceOrientationAbsoluteController.h" | 5 #include "modules/device_orientation/DeviceOrientationAbsoluteController.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
| 9 #include "modules/device_orientation/DeviceOrientationDispatcher.h" | 9 #include "modules/device_orientation/DeviceOrientationDispatcher.h" |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 return *controller; | 35 return *controller; |
| 36 } | 36 } |
| 37 | 37 |
| 38 void DeviceOrientationAbsoluteController::didAddEventListener( | 38 void DeviceOrientationAbsoluteController::didAddEventListener( |
| 39 LocalDOMWindow* window, | 39 LocalDOMWindow* window, |
| 40 const AtomicString& eventType) { | 40 const AtomicString& eventType) { |
| 41 if (eventType != eventTypeName()) | 41 if (eventType != eventTypeName()) |
| 42 return; | 42 return; |
| 43 | 43 |
| 44 if (document().frame()) { | 44 if (document().frame()) { |
| 45 String errorMessage; | 45 if (document().isSecureContext()) { |
| 46 if (document().isSecureContext(errorMessage)) { | |
| 47 UseCounter::count(document().frame(), | 46 UseCounter::count(document().frame(), |
| 48 UseCounter::DeviceOrientationAbsoluteSecureOrigin); | 47 UseCounter::DeviceOrientationAbsoluteSecureOrigin); |
| 49 } else { | 48 } else { |
| 50 Deprecation::countDeprecation( | 49 Deprecation::countDeprecation( |
| 51 document().frame(), | 50 document().frame(), |
| 52 UseCounter::DeviceOrientationAbsoluteInsecureOrigin); | 51 UseCounter::DeviceOrientationAbsoluteInsecureOrigin); |
| 53 // TODO: add rappor logging of insecure origins as in | 52 // TODO: add rappor logging of insecure origins as in |
| 54 // DeviceOrientationController. | 53 // DeviceOrientationController. |
| 55 if (document().frame()->settings()->strictPowerfulFeatureRestrictions()) | 54 if (document().frame()->settings()->strictPowerfulFeatureRestrictions()) |
| 56 return; | 55 return; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 69 | 68 |
| 70 const AtomicString& DeviceOrientationAbsoluteController::eventTypeName() const { | 69 const AtomicString& DeviceOrientationAbsoluteController::eventTypeName() const { |
| 71 return EventTypeNames::deviceorientationabsolute; | 70 return EventTypeNames::deviceorientationabsolute; |
| 72 } | 71 } |
| 73 | 72 |
| 74 DEFINE_TRACE(DeviceOrientationAbsoluteController) { | 73 DEFINE_TRACE(DeviceOrientationAbsoluteController) { |
| 75 DeviceOrientationController::trace(visitor); | 74 DeviceOrientationController::trace(visitor); |
| 76 } | 75 } |
| 77 | 76 |
| 78 } // namespace blink | 77 } // namespace blink |
| OLD | NEW |