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/DeviceMotionController.h" | 6 #include "modules/device_orientation/DeviceMotionController.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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 void DeviceMotionController::didAddEventListener(LocalDOMWindow* window, const A tomicString& eventType) | 47 void DeviceMotionController::didAddEventListener(LocalDOMWindow* window, const A tomicString& eventType) |
48 { | 48 { |
49 if (eventType != eventTypeName()) | 49 if (eventType != eventTypeName()) |
50 return; | 50 return; |
51 | 51 |
52 if (document().frame()) { | 52 if (document().frame()) { |
53 String errorMessage; | 53 String errorMessage; |
54 if (document().isPrivilegedContext(errorMessage)) { | 54 if (document().isPrivilegedContext(errorMessage)) { |
55 UseCounter::count(document().frame(), UseCounter::DeviceMotionSecure Origin); | 55 UseCounter::count(document().frame(), UseCounter::DeviceMotionSecure Origin); |
56 } else { | 56 } else { |
57 UseCounter::count(document().frame(), UseCounter::DeviceMotionInsecu reOrigin); | 57 UseCounter::countDeprecation(document().frame(), UseCounter::DeviceM otionInsecureOrigin); |
timvolodine
2015/04/30 10:47:45
should there be a similar change in DeviceOrientat
jww
2015/04/30 17:28:45
Yes, it should. Done!
| |
58 if (document().frame()->settings()->strictPowerfulFeatureRestriction s()) | 58 if (document().frame()->settings()->strictPowerfulFeatureRestriction s()) |
59 return; | 59 return; |
60 } | 60 } |
61 } | 61 } |
62 | 62 |
63 if (!m_hasEventListener) | 63 if (!m_hasEventListener) |
64 Platform::current()->recordRapporURL("DeviceSensors.DeviceMotion", WebUR L(document().url())); | 64 Platform::current()->recordRapporURL("DeviceSensors.DeviceMotion", WebUR L(document().url())); |
65 | 65 |
66 DeviceSingleWindowEventController::didAddEventListener(window, eventType); | 66 DeviceSingleWindowEventController::didAddEventListener(window, eventType); |
67 } | 67 } |
(...skipping 29 matching lines...) Expand all Loading... | |
97 return EventTypeNames::devicemotion; | 97 return EventTypeNames::devicemotion; |
98 } | 98 } |
99 | 99 |
100 DEFINE_TRACE(DeviceMotionController) | 100 DEFINE_TRACE(DeviceMotionController) |
101 { | 101 { |
102 DeviceSingleWindowEventController::trace(visitor); | 102 DeviceSingleWindowEventController::trace(visitor); |
103 WillBeHeapSupplement<Document>::trace(visitor); | 103 WillBeHeapSupplement<Document>::trace(visitor); |
104 } | 104 } |
105 | 105 |
106 } // namespace blink | 106 } // namespace blink |
OLD | NEW |