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_SCREEN_ORIENTATION_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_HOST_H_ |
6 #define CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_SCREEN_ORIENTATION_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/WebScreenOrientationLockType.h" | 9 #include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h" |
10 #include "third_party/WebKit/public/platform/WebScreenOrientationType.h" | 10 #include "third_party/WebKit/public/platform/WebScreenOrientationType.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
14 class ScreenOrientationProvider; | 14 class ScreenOrientationProvider; |
15 | 15 |
16 // ScreenOrientationDispatcherHost is a browser filter for Screen Orientation | 16 // ScreenOrientationDispatcherHost is a browser filter for Screen Orientation |
17 // messages and also helps dispatching messages about orientation changes to the | 17 // messages and also helps dispatching messages about orientation changes to the |
18 // renderers. | 18 // renderers. |
19 class CONTENT_EXPORT ScreenOrientationDispatcherHost | 19 class CONTENT_EXPORT ScreenOrientationDispatcherHost |
20 : public BrowserMessageFilter { | 20 : public BrowserMessageFilter { |
21 public: | 21 public: |
22 ScreenOrientationDispatcherHost(); | 22 ScreenOrientationDispatcherHost(); |
23 | 23 |
24 // BrowserMessageFilter | 24 // BrowserMessageFilter |
25 virtual bool OnMessageReceived(const IPC::Message&, bool*) OVERRIDE; | 25 virtual bool OnMessageReceived(const IPC::Message&) OVERRIDE; |
26 | 26 |
27 void OnOrientationChange(blink::WebScreenOrientationType orientation); | 27 void OnOrientationChange(blink::WebScreenOrientationType orientation); |
28 | 28 |
29 void SetProviderForTests(ScreenOrientationProvider* provider); | 29 void SetProviderForTests(ScreenOrientationProvider* provider); |
30 | 30 |
31 private: | 31 private: |
32 virtual ~ScreenOrientationDispatcherHost(); | 32 virtual ~ScreenOrientationDispatcherHost(); |
33 | 33 |
34 void OnLockRequest(blink::WebScreenOrientationLockType orientations); | 34 void OnLockRequest(blink::WebScreenOrientationLockType orientations); |
35 void OnUnlockRequest(); | 35 void OnUnlockRequest(); |
36 | 36 |
37 static ScreenOrientationProvider* CreateProvider(); | 37 static ScreenOrientationProvider* CreateProvider(); |
38 | 38 |
39 scoped_ptr<ScreenOrientationProvider> provider_; | 39 scoped_ptr<ScreenOrientationProvider> provider_; |
40 | 40 |
41 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDispatcherHost); | 41 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDispatcherHost); |
42 }; | 42 }; |
43 | 43 |
44 } // namespace content | 44 } // namespace content |
45 | 45 |
46 #endif // CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_HOST_
H_ | 46 #endif // CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_HOST_
H_ |
OLD | NEW |