OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Apple Inc. All rights reserved. | 2 * Copyright 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2012 Samsung Electronics. All rights reserved. | 3 * Copyright (C) 2012 Samsung Electronics. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above copyright | 10 * * Redistributions in binary form must reproduce the above copyright |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 const char* DeviceOrientationController::supplementName() | 57 const char* DeviceOrientationController::supplementName() |
58 { | 58 { |
59 return "DeviceOrientationController"; | 59 return "DeviceOrientationController"; |
60 } | 60 } |
61 | 61 |
62 DeviceOrientationController& DeviceOrientationController::from(Document& documen
t) | 62 DeviceOrientationController& DeviceOrientationController::from(Document& documen
t) |
63 { | 63 { |
64 DeviceOrientationController* controller = static_cast<DeviceOrientationContr
oller*>(DocumentSupplement::from(document, supplementName())); | 64 DeviceOrientationController* controller = static_cast<DeviceOrientationContr
oller*>(DocumentSupplement::from(document, supplementName())); |
65 if (!controller) { | 65 if (!controller) { |
66 controller = new DeviceOrientationController(document); | 66 controller = new DeviceOrientationController(document); |
67 DocumentSupplement::provideTo(document, supplementName(), adoptPtr(contr
oller)); | 67 DocumentSupplement::provideTo(document, supplementName(), adoptPtrWillBe
Noop(controller)); |
68 } | 68 } |
69 return *controller; | 69 return *controller; |
70 } | 70 } |
71 | 71 |
72 DeviceOrientationData* DeviceOrientationController::lastData() | 72 DeviceOrientationData* DeviceOrientationController::lastData() |
73 { | 73 { |
74 return m_overrideOrientationData ? m_overrideOrientationData.get() : DeviceO
rientationDispatcher::instance().latestDeviceOrientationData(); | 74 return m_overrideOrientationData ? m_overrideOrientationData.get() : DeviceO
rientationDispatcher::instance().latestDeviceOrientationData(); |
75 } | 75 } |
76 | 76 |
77 bool DeviceOrientationController::hasLastData() | 77 bool DeviceOrientationController::hasLastData() |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 void DeviceOrientationController::clearOverride() | 136 void DeviceOrientationController::clearOverride() |
137 { | 137 { |
138 if (!m_overrideOrientationData) | 138 if (!m_overrideOrientationData) |
139 return; | 139 return; |
140 m_overrideOrientationData.clear(); | 140 m_overrideOrientationData.clear(); |
141 DeviceOrientationData* orientation = lastData(); | 141 DeviceOrientationData* orientation = lastData(); |
142 if (orientation) | 142 if (orientation) |
143 didChangeDeviceOrientation(orientation); | 143 didChangeDeviceOrientation(orientation); |
144 } | 144 } |
145 | 145 |
| 146 void DeviceOrientationController::trace(Visitor* visitor) |
| 147 { |
| 148 visitor->trace(m_overrideOrientationData); |
| 149 } |
| 150 |
146 } // namespace WebCore | 151 } // namespace WebCore |
OLD | NEW |