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

Unified Diff: ash/content/display/screen_orientation_delegate_chromeos.h

Issue 723633003: Reland ScreenOrientationDelegate on ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix ChromeOS build error Created 6 years, 1 month 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
« no previous file with comments | « ash/content/display/DEPS ('k') | ash/content/display/screen_orientation_delegate_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/content/display/screen_orientation_delegate_chromeos.h
diff --git a/ash/content/display/screen_orientation_delegate_chromeos.h b/ash/content/display/screen_orientation_delegate_chromeos.h
new file mode 100644
index 0000000000000000000000000000000000000000..d1f445572d3e1580adfb905245f3fa142f832cc8
--- /dev/null
+++ b/ash/content/display/screen_orientation_delegate_chromeos.h
@@ -0,0 +1,64 @@
+// 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 ASH_CONTENT_DISPLAY_SCREEN_ORIENTATION_DELEGATE_CHROMEOS_H_
+#define ASH_CONTENT_DISPLAY_SCREEN_ORIENTATION_DELEGATE_CHROMEOS_H_
+
+#include "base/macros.h"
+#include "content/public/browser/screen_orientation_delegate.h"
+#include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h"
+
+namespace aura {
+class Window;
+}
+
+namespace content {
+class WebContents;
+}
+
+namespace ash {
+
+// Implements ChromeOS specific functionality for ScreenOrientationProvider.
+class ScreenOrientationDelegate : public content::ScreenOrientationDelegate {
+ public:
+ ScreenOrientationDelegate();
+ virtual ~ScreenOrientationDelegate();
+
+ // content::ScreenOrientationDelegate:
+ bool FullScreenRequired(content::WebContents* web_contents) override;
+ void Lock(content::WebContents* web_contents,
+ blink::WebScreenOrientationLockType lock_orientation) override;
+ bool ScreenOrientationProviderSupported() override;
+ void Unlock(content::WebContents* web_contents) override;
+
+ private:
+ // Locks rotation to the angle matching the primary orientation for
+ // |lock_orientation|.
+ void LockRotationToPrimaryOrientation(
+ blink::WebScreenOrientationLockType lock_orientation);
+
+ // Locks rotation to the angle matching the secondary orientation for
+ // |lock_orientation|.
+ void LockRotationToSecondaryOrientation(
+ blink::WebScreenOrientationLockType lock_orientation);
+
+ // For orientations that do not specify primary or secondary, locks to the
+ // current rotation if it matches |lock_orientation|. Otherwise locks to a
+ // matching rotation.
+ void LockToRotationMatchingOrientation(
+ blink::WebScreenOrientationLockType lock_orientation);
+
+ // The window that has applied the current lock. No other window can apply a
+ // lock until the current window unlocks rotation.
+ aura::Window* locking_window_;
+
+ // The orientation of the display when at a rotation of 0.
+ blink::WebScreenOrientationLockType natural_orientation_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDelegate);
+};
+
+} // namespace ash
+
+#endif // ASH_CONTENT_DISPLAY_SCREEN_ORIENTATION_DELEGATE_CHROMEOS_H_
« no previous file with comments | « ash/content/display/DEPS ('k') | ash/content/display/screen_orientation_delegate_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698