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

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

Issue 546453004: Centralize ScreenOrientationProvider logic, add platform delegates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screen_orientation_public_impl_split
Patch Set: Remove Factory Created 6 years, 2 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_delegate_android.h
diff --git a/content/browser/screen_orientation/screen_orientation_delegate_android.h b/content/browser/screen_orientation/screen_orientation_delegate_android.h
new file mode 100644
index 0000000000000000000000000000000000000000..e43968560e5fc21b172b856158d4080ca3811269
--- /dev/null
+++ b/content/browser/screen_orientation/screen_orientation_delegate_android.h
@@ -0,0 +1,50 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DELEGATE_H_
+#define CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DELEGATE_H_
+
+#include <jni.h>
+
+#include "base/macros.h"
+#include "content/public/browser/screen_orientation_delegate.h"
+#include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h"
+
+namespace content {
+
+class WebContents;
+
+// Android implementation of ScreenOrientationDelegate. The functionality of
+// ScreenOrientationProvider is always supported.
+class ScreenOrientationDelegateAndroid : public ScreenOrientationDelegate {
+ public:
+ ScreenOrientationDelegateAndroid();
+ virtual ~ScreenOrientationDelegateAndroid();
+
+ static bool Register(JNIEnv* env);
+
+ // Ask the ScreenOrientationListener (Java) to start accurately listening to
+ // the screen orientation. It keep track of the number of start request if it
+ // is already running an accurate listening.
+ static void StartAccurateListening();
+
+ // Ask the ScreenOrientationListener (Java) to stop accurately listening to
+ // the screen orientation. It will actually stop only if the number of stop
+ // requests matches the number of start requests.
+ static void StopAccurateListening();
+
+ // ScreenOrientationDelegate:
+ virtual bool FullScreenRequired(WebContents* web_contents) OVERRIDE;
+ virtual void Lock(
+ blink::WebScreenOrientationLockType lock_orientation) OVERRIDE;
+ virtual bool ScreenOrientationProviderSupported() OVERRIDE;
+ virtual void Unlock() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDelegateAndroid);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698