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 #include "third_party/WebKit/public/platform/WebScreenOrientation.h" |
| 11 |
| 12 namespace blink { |
| 13 class WebScreenOrientationListener; |
| 14 } |
| 15 |
| 16 namespace content { |
| 17 |
| 18 class RenderThread; |
| 19 |
| 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 { |
| 24 public: |
| 25 explicit ScreenOrientationDispatcher(RenderThread*); |
| 26 virtual ~ScreenOrientationDispatcher() {} |
| 27 |
| 28 // RenderProcessObserver |
| 29 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; |
| 30 |
| 31 void setListener(blink::WebScreenOrientationListener* listener); |
| 32 |
| 33 private: |
| 34 void OnOrientationChange(blink::WebScreenOrientation orientation); |
| 35 |
| 36 blink::WebScreenOrientationListener* listener_; |
| 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDispatcher); |
| 39 }; |
| 40 |
| 41 } // namespace content |
| 42 |
| 43 #endif // CONTENT_RENDERER_SCREEN_ORIENTATION_DISPATCHER_H_ |
OLD | NEW |