| 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/Settings.h" | 9 #include "core/frame/Settings.h" | 
| 10 #include "core/frame/UseCounter.h" | 10 #include "core/frame/UseCounter.h" | 
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 54 void DeviceOrientationController::didAddEventListener(LocalDOMWindow* window, co
     nst AtomicString& eventType) | 54 void DeviceOrientationController::didAddEventListener(LocalDOMWindow* window, co
     nst AtomicString& eventType) | 
| 55 { | 55 { | 
| 56     if (eventType != eventTypeName()) | 56     if (eventType != eventTypeName()) | 
| 57         return; | 57         return; | 
| 58 | 58 | 
| 59     if (document().frame()) { | 59     if (document().frame()) { | 
| 60         String errorMessage; | 60         String errorMessage; | 
| 61         if (document().isPrivilegedContext(errorMessage)) { | 61         if (document().isPrivilegedContext(errorMessage)) { | 
| 62             UseCounter::count(document().frame(), UseCounter::DeviceOrientationS
     ecureOrigin); | 62             UseCounter::count(document().frame(), UseCounter::DeviceOrientationS
     ecureOrigin); | 
| 63         } else { | 63         } else { | 
| 64             UseCounter::countDeprecation(document().frame(), UseCounter::DeviceO
     rientationInsecureOrigin); | 64             UseCounter::count(document().frame(), UseCounter::DeviceOrientationI
     nsecureOrigin); | 
| 65             if (document().frame()->settings()->strictPowerfulFeatureRestriction
     s()) | 65             if (document().frame()->settings()->strictPowerfulFeatureRestriction
     s()) | 
| 66                 return; | 66                 return; | 
| 67         } | 67         } | 
| 68     } | 68     } | 
| 69 | 69 | 
| 70     if (!m_hasEventListener) | 70     if (!m_hasEventListener) | 
| 71         Platform::current()->recordRapporURL("DeviceSensors.DeviceOrientation", 
     WebURL(document().url())); | 71         Platform::current()->recordRapporURL("DeviceSensors.DeviceOrientation", 
     WebURL(document().url())); | 
| 72 | 72 | 
| 73     DeviceSingleWindowEventController::didAddEventListener(window, eventType); | 73     DeviceSingleWindowEventController::didAddEventListener(window, eventType); | 
| 74 } | 74 } | 
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 126 } | 126 } | 
| 127 | 127 | 
| 128 DEFINE_TRACE(DeviceOrientationController) | 128 DEFINE_TRACE(DeviceOrientationController) | 
| 129 { | 129 { | 
| 130     visitor->trace(m_overrideOrientationData); | 130     visitor->trace(m_overrideOrientationData); | 
| 131     DeviceSingleWindowEventController::trace(visitor); | 131     DeviceSingleWindowEventController::trace(visitor); | 
| 132     WillBeHeapSupplement<Document>::trace(visitor); | 132     WillBeHeapSupplement<Document>::trace(visitor); | 
| 133 } | 133 } | 
| 134 | 134 | 
| 135 } // namespace blink | 135 } // namespace blink | 
| OLD | NEW | 
|---|