OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef CONTENT_RENDERER_SCREEN_ORIENTATION_DISPATCHER_H_ |
| 6 #define CONTENT_RENDERER_SCREEN_ORIENTATION_DISPATCHER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "content/public/renderer/render_process_observer.h" |
| 10 |
| 11 namespace blink { |
| 12 class WebScreenOrientationListener; |
| 13 } |
| 14 |
| 15 namespace content { |
| 16 |
| 17 class RenderThread; |
| 18 |
| 19 // ScreenOrientationDispatcher listens to message from the browser process and |
| 20 // dispatch the orientation change ones to the WebScreenOrientationListener. |
| 21 class ScreenOrientationDispatcher : public RenderProcessObserver { |
| 22 public: |
| 23 explicit ScreenOrientationDispatcher(RenderThread*); |
| 24 virtual ~ScreenOrientationDispatcher() {} |
| 25 |
| 26 // RenderProcessObserver |
| 27 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; |
| 28 |
| 29 void setListener(blink::WebScreenOrientationListener*); |
| 30 |
| 31 private: |
| 32 void OnOrientationChange(int orientation); |
| 33 |
| 34 blink::WebScreenOrientationListener* listener_; |
| 35 |
| 36 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDispatcher); |
| 37 }; |
| 38 |
| 39 } // namespace content |
| 40 |
| 41 #endif // CONTENT_RENDERER_SCREEN_ORIENTATION_DISPATCHER_H_ |
OLD | NEW |