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

Unified Diff: content/browser/screen_orientation/screen_orientation_provider_android.h

Issue 549603003: Create Mojo service for locking/unlocking screen orientation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix 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/browser/screen_orientation/screen_orientation_provider_android.h
diff --git a/content/browser/screen_orientation/screen_orientation_provider_android.h b/content/browser/screen_orientation/screen_orientation_provider_android.h
index c1a94f84f80cc138536094c45a6e5c1bb3f84f50..37785c3fb701cbc9813fe48e5bec7dc368ee5cae 100644
--- a/content/browser/screen_orientation/screen_orientation_provider_android.h
+++ b/content/browser/screen_orientation/screen_orientation_provider_android.h
@@ -10,24 +10,23 @@
#include "base/compiler_specific.h"
#include "content/public/browser/screen_orientation_provider.h"
#include "content/public/browser/web_contents_observer.h"
+#include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h"
namespace content {
-class ScreenOrientationDispatcherHost;
class WebContentsImpl;
class ScreenOrientationProviderAndroid : public ScreenOrientationProvider,
public WebContentsObserver {
public:
explicit ScreenOrientationProviderAndroid(
- ScreenOrientationDispatcherHost* dispatcher,
+ const ScreenOrientationLockCallback& on_result_callback,
WebContents* web_contents);
static bool Register(JNIEnv* env);
// ScreenOrientationProvider
- virtual void LockOrientation(int request_id,
- blink::WebScreenOrientationLockType) OVERRIDE;
+ virtual void LockOrientation(ScreenOrientationLockType lock_type) OVERRIDE;
virtual void UnlockOrientation() OVERRIDE;
virtual void OnOrientationChange() OVERRIDE;
@@ -58,19 +57,17 @@ class ScreenOrientationProviderAndroid : public ScreenOrientationProvider,
virtual ~ScreenOrientationProviderAndroid();
- // ScreenOrientationDispatcherHost owns ScreenOrientationProvider so
- // dispatcher_ should not point to an invalid memory.
- ScreenOrientationDispatcherHost* dispatcher_;
+ // The callback that should be invoked when a lock request receives a
+ // result.
+ ScreenOrientationLockCallback on_result_callback_;
// Whether the ScreenOrientationProvider currently has a lock applied.
bool lock_applied_;
- struct LockInformation {
- LockInformation(int request_id, blink::WebScreenOrientationLockType lock);
- int request_id;
- blink::WebScreenOrientationLockType lock;
- };
- LockInformation* pending_lock_;
+ // The requested orientation of the pending lock request, or
+ // blink::WebScreenOrientationLockDefault if there is no pending lock
+ // request.
+ blink::WebScreenOrientationLockType pending_lock_orientation_;
DISALLOW_COPY_AND_ASSIGN(ScreenOrientationProviderAndroid);
};

Powered by Google App Engine
This is Rietveld 408576698