diff options
Diffstat (limited to 'WebKit/android/jni/DeviceOrientationManager.h')
-rw-r--r-- | WebKit/android/jni/DeviceOrientationManager.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/WebKit/android/jni/DeviceOrientationManager.h b/WebKit/android/jni/DeviceOrientationManager.h index 0e43c18..a0da32f 100644 --- a/WebKit/android/jni/DeviceOrientationManager.h +++ b/WebKit/android/jni/DeviceOrientationManager.h @@ -26,9 +26,11 @@ #ifndef DeviceOrientationManager_h #define DeviceOrientationManager_h +#include <DeviceOrientation.h> #include <DeviceOrientationClient.h> -#include <PassRefPtr.h> #include <OwnPtr.h> +#include <PassRefPtr.h> +#include <RefPtr.h> namespace WebCore { class DeviceOrientation; @@ -36,20 +38,26 @@ class DeviceOrientation; namespace android { -// This class handles providing a client for DeviceOrientation. This is -// non-trivial because of the need to be able to use and configure a mock -// client. This class is owned by WebViewCore and exists to keep cruft out of -// that class. +class WebViewCore; + +// This class takes care of the fact that the client used for DeviceOrientation +// may be either the real implementation or a mock. It also handles setting the +// orientation on both the real and mock clients. This class is owned by +// WebViewCore and exists to keep cruft out of that class. class DeviceOrientationManager { public: - DeviceOrientationManager(); + DeviceOrientationManager(WebViewCore*); void useMock(); void setMockOrientation(PassRefPtr<WebCore::DeviceOrientation>); + void onOrientationChange(PassRefPtr<WebCore::DeviceOrientation>); + void maybeSuspendClient(); + void maybeResumeClient(); WebCore::DeviceOrientationClient* client(); private: bool m_useMock; + WebViewCore* m_webViewCore; OwnPtr<WebCore::DeviceOrientationClient> m_client; }; |