| Index: content/renderer/screen_orientation/screen_orientation_dispatcher.h
|
| diff --git a/content/renderer/screen_orientation/screen_orientation_dispatcher.h b/content/renderer/screen_orientation/screen_orientation_dispatcher.h
|
| index fe215b936f11ed69354e165568d209c72858beb9..6e0d9a8b8f85ec00180e65b0b845a1b8ec10914a 100644
|
| --- a/content/renderer/screen_orientation/screen_orientation_dispatcher.h
|
| +++ b/content/renderer/screen_orientation/screen_orientation_dispatcher.h
|
| @@ -8,7 +8,8 @@
|
| #include "base/compiler_specific.h"
|
| #include "base/id_map.h"
|
| #include "base/macros.h"
|
| -#include "content/public/renderer/render_frame_observer.h"
|
| +#include "content/common/content_export.h"
|
| +#include "content/common/screen_orientation_service.mojom.h"
|
| #include "third_party/WebKit/public/platform/WebLockOrientationCallback.h"
|
| #include "third_party/WebKit/public/platform/WebScreenOrientationClient.h"
|
| #include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h"
|
| @@ -16,34 +17,30 @@
|
|
|
| namespace content {
|
|
|
| -class RenderFrame;
|
| +class ServiceRegistry;
|
|
|
| // ScreenOrientationDispatcher implements the WebScreenOrientationClient API
|
| // which handles screen lock. It sends lock (or unlock) requests to the browser
|
| // process and listens for responses and let Blink know about the result of the
|
| // request via WebLockOrientationCallback.
|
| class CONTENT_EXPORT ScreenOrientationDispatcher :
|
| - public RenderFrameObserver,
|
| NON_EXPORTED_BASE(public blink::WebScreenOrientationClient) {
|
| public:
|
| - explicit ScreenOrientationDispatcher(RenderFrame* render_frame);
|
| + explicit ScreenOrientationDispatcher(
|
| + ScreenOrientationService* screen_orientation_service);
|
| virtual ~ScreenOrientationDispatcher();
|
|
|
| private:
|
| friend class ScreenOrientationDispatcherTest;
|
|
|
| - // RenderFrameObserver implementation.
|
| - virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
|
| -
|
| // blink::WebScreenOrientationClient implementation.
|
| virtual void lockOrientation(
|
| blink::WebScreenOrientationLockType orientation,
|
| blink::WebLockOrientationCallback* callback) OVERRIDE;
|
| virtual void unlockOrientation() OVERRIDE;
|
|
|
| - void OnLockSuccess(int request_id);
|
| - void OnLockError(int request_id,
|
| - blink::WebLockOrientationError error);
|
| + void OnLockOrientationResult(int request_id,
|
| + ScreenOrientationLockResult result);
|
|
|
| void CancelPendingLocks();
|
|
|
| @@ -54,6 +51,7 @@ class CONTENT_EXPORT ScreenOrientationDispatcher :
|
| // which is what IDMap was designed for.
|
| typedef IDMap<blink::WebLockOrientationCallback, IDMapOwnPointer> CallbackMap;
|
| CallbackMap pending_callbacks_;
|
| + ScreenOrientationService* screen_orientation_service_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDispatcher);
|
| };
|
|
|