Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(645)

Unified Diff: content/public/browser/screen_orientation_provider.h

Issue 549603003: Create Mojo service for locking/unlocking screen orientation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/browser/screen_orientation_provider.h
diff --git a/content/public/browser/screen_orientation_provider.h b/content/public/browser/screen_orientation_provider.h
index c94fbe7239219326d1810b7cc4bc8d095bfd1fda..d545e76dc5890fc4be43cd43ad83632f2d05523b 100644
--- a/content/public/browser/screen_orientation_provider.h
+++ b/content/public/browser/screen_orientation_provider.h
@@ -5,23 +5,28 @@
#ifndef CONTENT_PUBLIC_BROWSER_SCREEN_ORIENTATION_PROVIDER_H_
#define CONTENT_PUBLIC_BROWSER_SCREEN_ORIENTATION_PROVIDER_H_
+#include "base/callback.h"
#include "base/macros.h"
#include "content/common/content_export.h"
-#include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h"
+#include "content/public/common/screen_orientation.mojom.h"
namespace content {
-class ScreenOrientationDispatcherHost;
class WebContents;
+class WebContentsImpl;
+
+typedef base::Callback<void(ScreenOrientationLockResult)>
+ ScreenOrientationLockCallback;
// Interface that needs to be implemented by any backend that wants to handle
// screen orientation lock/unlock.
class CONTENT_EXPORT ScreenOrientationProvider {
public:
- // Lock the screen orientation to |orientations|.
+ // Lock the screen orientation to |lock_type|. |callback| is the callback
+ // that should be invoked when this request receives a result.
virtual void LockOrientation(
- int request_id,
- blink::WebScreenOrientationLockType orientations) = 0;
+ ScreenOrientationLockType lock_type,
+ const ScreenOrientationLockCallback& callback) = 0;
// Unlock the screen orientation.
virtual void UnlockOrientation() = 0;
@@ -33,12 +38,10 @@ class CONTENT_EXPORT ScreenOrientationProvider {
virtual ~ScreenOrientationProvider() {}
protected:
- friend class ScreenOrientationDispatcherHostImpl;
+ friend class WebContentsImpl;
static ScreenOrientationProvider* Create(
- ScreenOrientationDispatcherHost* dispatcher_host,
WebContents* web_contents);
-
ScreenOrientationProvider() {}
DISALLOW_COPY_AND_ASSIGN(ScreenOrientationProvider);
@@ -47,11 +50,10 @@ class CONTENT_EXPORT ScreenOrientationProvider {
#if !defined(OS_ANDROID)
// static
ScreenOrientationProvider* ScreenOrientationProvider::Create(
- ScreenOrientationDispatcherHost* dispatcher_host,
WebContents* web_contents) {
return NULL;
}
-#endif // !defined(OS_ANDROID)
+#endif // !defined(OS_ANDROID)
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698