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/OriginsUsingFeatures.h" | 9 #include "core/frame/OriginsUsingFeatures.h" |
10 #include "core/frame/Settings.h" | 10 #include "core/frame/Settings.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 dispatchDeviceEvent(lastEvent()); | 36 dispatchDeviceEvent(lastEvent()); |
37 } | 37 } |
38 | 38 |
39 const char* DeviceOrientationController::supplementName() | 39 const char* DeviceOrientationController::supplementName() |
40 { | 40 { |
41 return "DeviceOrientationController"; | 41 return "DeviceOrientationController"; |
42 } | 42 } |
43 | 43 |
44 DeviceOrientationController& DeviceOrientationController::from(Document& documen
t) | 44 DeviceOrientationController& DeviceOrientationController::from(Document& documen
t) |
45 { | 45 { |
46 DeviceOrientationController* controller = static_cast<DeviceOrientationContr
oller*>(HeapSupplement<Document>::from(document, supplementName())); | 46 DeviceOrientationController* controller = static_cast<DeviceOrientationContr
oller*>(Supplement<Document>::from(document, supplementName())); |
47 if (!controller) { | 47 if (!controller) { |
48 controller = new DeviceOrientationController(document); | 48 controller = new DeviceOrientationController(document); |
49 HeapSupplement<Document>::provideTo(document, supplementName(), controll
er); | 49 Supplement<Document>::provideTo(document, supplementName(), controller); |
50 } | 50 } |
51 return *controller; | 51 return *controller; |
52 } | 52 } |
53 | 53 |
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()) { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 128 |
129 DeviceOrientationDispatcher& DeviceOrientationController::dispatcherInstance() c
onst | 129 DeviceOrientationDispatcher& DeviceOrientationController::dispatcherInstance() c
onst |
130 { | 130 { |
131 return DeviceOrientationDispatcher::instance(false); | 131 return DeviceOrientationDispatcher::instance(false); |
132 } | 132 } |
133 | 133 |
134 DEFINE_TRACE(DeviceOrientationController) | 134 DEFINE_TRACE(DeviceOrientationController) |
135 { | 135 { |
136 visitor->trace(m_overrideOrientationData); | 136 visitor->trace(m_overrideOrientationData); |
137 DeviceSingleWindowEventController::trace(visitor); | 137 DeviceSingleWindowEventController::trace(visitor); |
138 HeapSupplement<Document>::trace(visitor); | 138 Supplement<Document>::trace(visitor); |
139 } | 139 } |
140 | 140 |
141 } // namespace blink | 141 } // namespace blink |
OLD | NEW |