1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_RENDERER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_H_
6 #define CONTENT_RENDERER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_H_
8 #include "base/macros.h"
9 #include "content/public/renderer/render_process_observer.h"
10 #include "third_party/WebKit/public/platform/WebScreenOrientationType.h"
13 class WebScreenOrientationListener
;
20 // ScreenOrientationDispatcher listens to message from the browser process and
21 // dispatch the orientation change ones to the WebScreenOrientationListener.
22 class CONTENT_EXPORT ScreenOrientationDispatcher
23 : public RenderProcessObserver
{
25 explicit ScreenOrientationDispatcher(RenderThread
*);
26 virtual ~ScreenOrientationDispatcher() {}
28 // RenderProcessObserver
29 virtual bool OnControlMessageReceived(const IPC::Message
& message
) OVERRIDE
;
31 void setListener(blink::WebScreenOrientationListener
* listener
);
34 void OnOrientationChange(blink::WebScreenOrientationType orientation
);
36 blink::WebScreenOrientationListener
* listener_
;
38 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDispatcher
);
41 } // namespace content
43 #endif // CONTENT_RENDERER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_H_