Chromium Code Reviews| 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 27 matching lines...) Expand all Loading... | |
| 38 | 38 |
| 39 class DeviceOrientationController FINAL : public DeviceSensorEventController, pu blic DocumentSupplement, public DOMWindowLifecycleObserver { | 39 class DeviceOrientationController FINAL : public DeviceSensorEventController, pu blic DocumentSupplement, public DOMWindowLifecycleObserver { |
| 40 | 40 |
| 41 public: | 41 public: |
| 42 virtual ~DeviceOrientationController(); | 42 virtual ~DeviceOrientationController(); |
| 43 | 43 |
| 44 static const char* supplementName(); | 44 static const char* supplementName(); |
| 45 static DeviceOrientationController& from(Document&); | 45 static DeviceOrientationController& from(Document&); |
| 46 | 46 |
| 47 void didChangeDeviceOrientation(WebCore::DeviceOrientationData*); | 47 void didChangeDeviceOrientation(WebCore::DeviceOrientationData*); |
| 48 void setOverride(WebCore::DeviceOrientationData*); | |
| 49 void clearOverride(); | |
| 48 | 50 |
| 49 // Inherited from DOMWindowLifecycleObserver | 51 // Inherited from DOMWindowLifecycleObserver |
| 50 virtual void didAddEventListener(DOMWindow*, const AtomicString&) OVERRIDE; | 52 virtual void didAddEventListener(DOMWindow*, const AtomicString&) OVERRIDE; |
| 51 virtual void didRemoveEventListener(DOMWindow*, const AtomicString&) OVERRID E; | 53 virtual void didRemoveEventListener(DOMWindow*, const AtomicString&) OVERRID E; |
| 52 virtual void didRemoveAllEventListeners(DOMWindow*) OVERRIDE; | 54 virtual void didRemoveAllEventListeners(DOMWindow*) OVERRIDE; |
| 53 | 55 |
| 54 private: | 56 private: |
| 55 explicit DeviceOrientationController(Document&); | 57 explicit DeviceOrientationController(Document&); |
| 56 virtual void registerWithDispatcher() OVERRIDE; | 58 virtual void registerWithDispatcher() OVERRIDE; |
| 57 virtual void unregisterWithDispatcher() OVERRIDE; | 59 virtual void unregisterWithDispatcher() OVERRIDE; |
| 58 | 60 |
| 61 WebCore::DeviceOrientationData* lastData(); | |
| 59 virtual bool hasLastData() OVERRIDE; | 62 virtual bool hasLastData() OVERRIDE; |
| 60 virtual PassRefPtr<Event> getLastEvent() OVERRIDE; | 63 virtual PassRefPtr<Event> getLastEvent() OVERRIDE; |
| 61 virtual bool isNullEvent(Event*) OVERRIDE; | 64 virtual bool isNullEvent(Event*) OVERRIDE; |
| 65 | |
| 66 RefPtrWillBeMember<WebCore::DeviceOrientationData> m_lastOrientation; | |
|
timvolodine
2014/03/25 15:06:33
I don't really see why m_lastOrientation is needed
dgozman
2014/03/25 17:50:30
You are right. I thought we should keep the last d
| |
| 67 RefPtrWillBeMember<WebCore::DeviceOrientationData> m_override; | |
| 62 }; | 68 }; |
| 63 | 69 |
| 64 } // namespace WebCore | 70 } // namespace WebCore |
| 65 | 71 |
| 66 #endif // DeviceOrientationController_h | 72 #endif // DeviceOrientationController_h |
| OLD | NEW |