| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_SCREEN_ORIENTATION_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_SCREEN_ORIENTATION_DISPATCHER_HOST_H_ |
| 6 #define CONTENT_BROWSER_SCREEN_ORIENTATION_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_SCREEN_ORIENTATION_DISPATCHER_HOST_H_ |
| 7 | 7 |
| 8 #include "content/public/browser/browser_message_filter.h" | 8 #include "content/public/browser/browser_message_filter.h" |
| 9 #include "third_party/WebKit/public/platform/WebScreenOrientation.h" | 9 #include "third_party/WebKit/public/platform/WebScreenOrientation.h" |
| 10 | 10 |
| 11 namespace content { | 11 namespace content { |
| 12 | 12 |
| 13 // ScreenOrientationDispatcherHost | 13 class ScreenOrientationProvider; |
| 14 class ScreenOrientationDispatcherHost : public BrowserMessageFilter { | 14 |
| 15 // ScreenOrientationDispatcherHost is a browser filter for Screen Orientation |
| 16 // messages and also helps dispatching messages about orientation changes to the |
| 17 // renderers. |
| 18 class CONTENT_EXPORT ScreenOrientationDispatcherHost |
| 19 : public BrowserMessageFilter { |
| 15 public: | 20 public: |
| 16 ScreenOrientationDispatcherHost(); | 21 ScreenOrientationDispatcherHost(); |
| 17 | 22 |
| 18 // BrowserMessageFilter | 23 // BrowserMessageFilter |
| 19 virtual bool OnMessageReceived(const IPC::Message&, bool*) OVERRIDE; | 24 virtual bool OnMessageReceived(const IPC::Message&, bool*) OVERRIDE; |
| 20 | 25 |
| 21 void OnOrientationChange(blink::WebScreenOrientation orientation); | 26 void OnOrientationChange(blink::WebScreenOrientation orientation); |
| 22 | 27 |
| 23 private: | 28 void SetProviderForTests(ScreenOrientationProvider* provider); |
| 24 virtual ~ScreenOrientationDispatcherHost() {} | 29 |
| 30 private: |
| 31 virtual ~ScreenOrientationDispatcherHost(); |
| 32 |
| 33 void OnLockRequest(blink::WebScreenOrientations orientations); |
| 34 void OnUnlockRequest(); |
| 35 |
| 36 static ScreenOrientationProvider* CreateProvider(); |
| 37 |
| 38 scoped_ptr<ScreenOrientationProvider> provider_; |
| 25 | 39 |
| 26 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDispatcherHost); | 40 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDispatcherHost); |
| 27 }; | 41 }; |
| 28 | 42 |
| 29 } // namespace content | 43 } // namespace content |
| 30 | 44 |
| 31 #endif // CONTENT_BROWSER_SCREEN_ORIENTATION_DISPATCHER_HOST_H_ | 45 #endif // CONTENT_BROWSER_SCREEN_ORIENTATION_DISPATCHER_HOST_H_ |
| OLD | NEW |