Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Unified Diff: content/browser/screen_orientation/screen_orientation_dispatcher_host.h

Issue 327573002: Properly route screen orientation IPC messages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screen_lock_view
Patch Set: review comments Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698