Index: content/browser/screen_orientation/screen_orientation_dispatcher_host.h |
diff --git a/content/browser/screen_orientation/screen_orientation_dispatcher_host.h b/content/browser/screen_orientation/screen_orientation_dispatcher_host.h |
index 363c08c6ec13cf17afac14bb43024f4313b21370..c86854a83adf59abe8b79aa6b6d7095514aff4a9 100644 |
--- a/content/browser/screen_orientation/screen_orientation_dispatcher_host.h |
+++ b/content/browser/screen_orientation/screen_orientation_dispatcher_host.h |
@@ -5,36 +5,38 @@ |
#ifndef CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_HOST_H_ |
#define CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_HOST_H_ |
-#include "content/public/browser/browser_message_filter.h" |
+#include "content/public/browser/web_contents_observer.h" |
#include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h" |
#include "third_party/WebKit/public/platform/WebScreenOrientationType.h" |
namespace content { |
+class RenderFrameHost; |
class ScreenOrientationProvider; |
+class WebContents; |
-// ScreenOrientationDispatcherHost is a browser filter for Screen Orientation |
-// messages and also helps dispatching messages about orientation changes to the |
-// renderers. |
+// ScreenOrientationDispatcherHost receives lock and unlock requests from the |
+// RenderFrames and dispatch them to the ScreenOrientationProvider. It also |
+// make sure that the right RenderFrame get replied for each lock request. |
class CONTENT_EXPORT ScreenOrientationDispatcherHost |
- : public BrowserMessageFilter { |
+ : public WebContentsObserver { |
public: |
- ScreenOrientationDispatcherHost(); |
+ explicit ScreenOrientationDispatcherHost(WebContents* web_contents); |
+ virtual ~ScreenOrientationDispatcherHost(); |
- // BrowserMessageFilter |
- virtual bool OnMessageReceived(const IPC::Message&) OVERRIDE; |
+ // WebContentsObserver |
+ virtual bool OnMessageReceived(const IPC::Message&, |
+ RenderFrameHost* render_frame_host) OVERRIDE; |
void OnOrientationChange(blink::WebScreenOrientationType orientation); |
void SetProviderForTests(ScreenOrientationProvider* provider); |
- protected: |
- virtual ~ScreenOrientationDispatcherHost(); |
- |
private: |
- void OnLockRequest(blink::WebScreenOrientationLockType orientation, |
+ void OnLockRequest(RenderFrameHost* render_frame_host, |
+ blink::WebScreenOrientationLockType orientation, |
int request_id); |
- void OnUnlockRequest(); |
+ void OnUnlockRequest(RenderFrameHost* render_frame_host); |
static ScreenOrientationProvider* CreateProvider(); |