Chromium Code Reviews| 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() {} | |
| 25 | 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_; | |
|
jochen (gone - plz use gerrit)
2014/02/25 16:23:06
with this design, you will have one provider per p
mlamouri (slow - plz ping)
2014/02/28 11:53:30
I think for the moment, the only requirement we ha
| |
| 26 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDispatcherHost); | 39 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDispatcherHost); |
|
jochen (gone - plz use gerrit)
2014/02/25 16:23:06
nit. add empty line before this line
mlamouri (slow - plz ping)
2014/02/28 11:53:30
Done.
| |
| 27 }; | 40 }; |
| 28 | 41 |
| 29 } // namespace content | 42 } // namespace content |
| 30 | 43 |
| 31 #endif // CONTENT_BROWSER_SCREEN_ORIENTATION_DISPATCHER_HOST_H_ | 44 #endif // CONTENT_BROWSER_SCREEN_ORIENTATION_DISPATCHER_HOST_H_ |
| OLD | NEW |