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_PROVIDER_H_
6 #define CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_PROVIDER_H_
8 #include "base/macros.h"
9 #include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h"
13 class ScreenOrientationDispatcherHost
;
16 // Interface that needs to be implemented by any backend that wants to handle
17 // screen orientation lock/unlock.
18 class ScreenOrientationProvider
{
20 // Lock the screen orientation to |orientations|.
21 virtual void LockOrientation(
23 blink::WebScreenOrientationLockType orientations
) = 0;
25 // Unlock the screen orientation.
26 virtual void UnlockOrientation() = 0;
28 // Inform about a screen orientation update. It is called to let the provider
29 // know if a lock has been resolved.
30 virtual void OnOrientationChange() = 0;
32 virtual ~ScreenOrientationProvider() {}
35 friend class ScreenOrientationDispatcherHost
;
37 static ScreenOrientationProvider
* Create(
38 ScreenOrientationDispatcherHost
* dispatcher_host
,
39 WebContents
* web_contents
);
41 ScreenOrientationProvider() {}
43 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationProvider
);
46 #if !defined(OS_ANDROID)
48 ScreenOrientationProvider
* ScreenOrientationProvider::Create(
49 ScreenOrientationDispatcherHost
* dispatcher_host
,
50 WebContents
* web_contents
) {
53 #endif // !defined(OS_ANDROID)
55 } // namespace content
57 #endif // CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_PROVIDER_H_