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 11 matching lines...) Expand all Loading... |
22 #endif | 22 #endif |
23 } | 23 } |
24 | 24 |
25 const char* DeviceOrientationAbsoluteController::supplementName() | 25 const char* DeviceOrientationAbsoluteController::supplementName() |
26 { | 26 { |
27 return "DeviceOrientationAbsoluteController"; | 27 return "DeviceOrientationAbsoluteController"; |
28 } | 28 } |
29 | 29 |
30 DeviceOrientationAbsoluteController& DeviceOrientationAbsoluteController::from(D
ocument& document) | 30 DeviceOrientationAbsoluteController& DeviceOrientationAbsoluteController::from(D
ocument& document) |
31 { | 31 { |
32 DeviceOrientationAbsoluteController* controller = static_cast<DeviceOrientat
ionAbsoluteController*>(HeapSupplement<Document>::from(document, DeviceOrientati
onAbsoluteController::supplementName())); | 32 DeviceOrientationAbsoluteController* controller = static_cast<DeviceOrientat
ionAbsoluteController*>(Supplement<Document>::from(document, DeviceOrientationAb
soluteController::supplementName())); |
33 if (!controller) { | 33 if (!controller) { |
34 controller = new DeviceOrientationAbsoluteController(document); | 34 controller = new DeviceOrientationAbsoluteController(document); |
35 HeapSupplement<Document>::provideTo(document, DeviceOrientationAbsoluteC
ontroller::supplementName(), controller); | 35 Supplement<Document>::provideTo(document, DeviceOrientationAbsoluteContr
oller::supplementName(), controller); |
36 } | 36 } |
37 return *controller; | 37 return *controller; |
38 } | 38 } |
39 | 39 |
40 void DeviceOrientationAbsoluteController::didAddEventListener(LocalDOMWindow* wi
ndow, const AtomicString& eventType) | 40 void DeviceOrientationAbsoluteController::didAddEventListener(LocalDOMWindow* wi
ndow, const AtomicString& eventType) |
41 { | 41 { |
42 if (eventType != eventTypeName()) | 42 if (eventType != eventTypeName()) |
43 return; | 43 return; |
44 | 44 |
45 if (document().frame()) { | 45 if (document().frame()) { |
(...skipping 22 matching lines...) Expand all Loading... |
68 { | 68 { |
69 return EventTypeNames::deviceorientationabsolute; | 69 return EventTypeNames::deviceorientationabsolute; |
70 } | 70 } |
71 | 71 |
72 DEFINE_TRACE(DeviceOrientationAbsoluteController) | 72 DEFINE_TRACE(DeviceOrientationAbsoluteController) |
73 { | 73 { |
74 DeviceOrientationController::trace(visitor); | 74 DeviceOrientationController::trace(visitor); |
75 } | 75 } |
76 | 76 |
77 } // namespace blink | 77 } // namespace blink |
OLD | NEW |