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 "third_party/WebKit/public/platform/WebScreenOrientationLockType.h"
12 class ScreenOrientationDispatcherHost
;
15 // Interface that needs to be implemented by any backend that wants to handle
16 // screen orientation lock/unlock.
17 class ScreenOrientationProvider
{
19 // Lock the screen orientation to |orientations|.
20 virtual void LockOrientation(
22 blink::WebScreenOrientationLockType orientations
) = 0;
24 // Unlock the screen orientation.
25 virtual void UnlockOrientation() = 0;
27 // Inform about a screen orientation update. It is called to let the provider
28 // know if a lock has been resolved.
29 virtual void OnOrientationChange() = 0;
31 virtual ~ScreenOrientationProvider() {}
34 friend class ScreenOrientationDispatcherHost
;
36 static ScreenOrientationProvider
* Create(
37 ScreenOrientationDispatcherHost
* dispatcher_host
,
38 WebContents
* web_contents
);
40 ScreenOrientationProvider() {}
42 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationProvider
);
45 #if !defined(OS_ANDROID)
47 ScreenOrientationProvider
* ScreenOrientationProvider::Create(
48 ScreenOrientationDispatcherHost
* dispatcher_host
,
49 WebContents
* web_contents
) {
52 #endif // !defined(OS_ANDROID)
54 } // namespace content
56 #endif // CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_PROVIDER_H_