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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 const char* DeviceMotionController::supplementName() | 56 const char* DeviceMotionController::supplementName() |
57 { | 57 { |
58 return "DeviceMotionController"; | 58 return "DeviceMotionController"; |
59 } | 59 } |
60 | 60 |
61 DeviceMotionController& DeviceMotionController::from(Document& document) | 61 DeviceMotionController& DeviceMotionController::from(Document& document) |
62 { | 62 { |
63 DeviceMotionController* controller = static_cast<DeviceMotionController*>(Do
cumentSupplement::from(document, supplementName())); | 63 DeviceMotionController* controller = static_cast<DeviceMotionController*>(Do
cumentSupplement::from(document, supplementName())); |
64 if (!controller) { | 64 if (!controller) { |
65 controller = new DeviceMotionController(document); | 65 controller = new DeviceMotionController(document); |
66 DocumentSupplement::provideTo(document, supplementName(), adoptPtr(contr
oller)); | 66 DocumentSupplement::provideTo(document, supplementName(), adoptPtrWillBe
Noop(controller)); |
67 } | 67 } |
68 return *controller; | 68 return *controller; |
69 } | 69 } |
70 | 70 |
71 bool DeviceMotionController::hasLastData() | 71 bool DeviceMotionController::hasLastData() |
72 { | 72 { |
73 return DeviceMotionDispatcher::instance().latestDeviceMotionData(); | 73 return DeviceMotionDispatcher::instance().latestDeviceMotionData(); |
74 } | 74 } |
75 | 75 |
76 PassRefPtrWillBeRawPtr<Event> DeviceMotionController::getLastEvent() | 76 PassRefPtrWillBeRawPtr<Event> DeviceMotionController::getLastEvent() |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 m_hasEventListener = false; | 119 m_hasEventListener = false; |
120 } | 120 } |
121 | 121 |
122 void DeviceMotionController::didRemoveAllEventListeners(DOMWindow*) | 122 void DeviceMotionController::didRemoveAllEventListeners(DOMWindow*) |
123 { | 123 { |
124 stopUpdating(); | 124 stopUpdating(); |
125 m_hasEventListener = false; | 125 m_hasEventListener = false; |
126 } | 126 } |
127 | 127 |
128 } // namespace WebCore | 128 } // namespace WebCore |
OLD | NEW |