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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef ASH_CONTENT_DISPLAY_SCREEN_ORIENTATION_DELEGATE_CHROMEOS_H_
6 #define ASH_CONTENT_DISPLAY_SCREEN_ORIENTATION_DELEGATE_CHROMEOS_H_
7
8 #include "base/macros.h"
9 #include "content/public/browser/screen_orientation_delegate.h"
10 #include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h"
11
12 namespace aura {
13 class Window;
14 }
15
16 namespace content {
17 class WebContents;
18 }
19
20 namespace ash {
21
22 // Implements ChromeOS specific functionality for ScreenOrientationProvider.
23 class ScreenOrientationDelegate : public content::ScreenOrientationDelegate {
24 public:
25 ScreenOrientationDelegate();
26 virtual ~ScreenOrientationDelegate();
27
28 // content::ScreenOrientationDelegate:
29 bool FullScreenRequired(content::WebContents* web_contents) override;
30 void Lock(content::WebContents* web_contents,
31 blink::WebScreenOrientationLockType lock_orientation) override;
32 bool ScreenOrientationProviderSupported() override;
33 void Unlock(content::WebContents* web_contents) override;
34
35 private:
36 // Locks rotation to the angle matching the primary orientation for
37 // |lock_orientation|.
38 void LockRotationToPrimaryOrientation(
39 blink::WebScreenOrientationLockType lock_orientation);
40
41 // Locks rotation to the angle matching the secondary orientation for
42 // |lock_orientation|.
43 void LockRotationToSecondaryOrientation(
44 blink::WebScreenOrientationLockType lock_orientation);
45
46 // For orientations that do not specify primary or secondary, locks to the
47 // current rotation if it matches |lock_orientation|. Otherwise locks to a
48 // matching rotation.
49 void LockToRotationMatchingOrientation(
50 blink::WebScreenOrientationLockType lock_orientation);
51
52 // The window that has applied the current lock. No other window can apply a
53 // lock until the current window unlocks rotation.
54 aura::Window* locking_window_;
55
56 // The orientation of the display when at a rotation of 0.
57 blink::WebScreenOrientationLockType natural_orientation_;
58
59 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDelegate);
60 };
61
62 } // namespace ash
63
64 #endif // ASH_CONTENT_DISPLAY_SCREEN_ORIENTATION_DELEGATE_CHROMEOS_H_
OLDNEW
« 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