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.
5 #ifndef CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_HOST_H_
6 #define CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_HOST_H_
8 #include "content/public/browser/browser_message_filter.h"
9 #include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h"
10 #include "third_party/WebKit/public/platform/WebScreenOrientationType.h"
14 class ScreenOrientationProvider
;
16 // ScreenOrientationDispatcherHost is a browser filter for Screen Orientation
17 // messages and also helps dispatching messages about orientation changes to the
19 class CONTENT_EXPORT ScreenOrientationDispatcherHost
20 : public BrowserMessageFilter
{
22 ScreenOrientationDispatcherHost();
24 // BrowserMessageFilter
25 virtual bool OnMessageReceived(const IPC::Message
&, bool*) OVERRIDE
;
27 void OnOrientationChange(blink::WebScreenOrientationType orientation
);
29 void SetProviderForTests(ScreenOrientationProvider
* provider
);
32 virtual ~ScreenOrientationDispatcherHost();
34 void OnLockRequest(blink::WebScreenOrientationLockType orientations
);
35 void OnUnlockRequest();
37 static ScreenOrientationProvider
* CreateProvider();
39 scoped_ptr
<ScreenOrientationProvider
> provider_
;
41 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDispatcherHost
);
44 } // namespace content
46 #endif // CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DISPATCHER_HOST_H_