OLD | NEW |
(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_DISPLAY_SCREEN_ORIENTATION_DELEGATE_CHROMEOS_H_ |
| 6 #define ASH_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 content { |
| 13 class WebContents; |
| 14 } |
| 15 |
| 16 namespace ash { |
| 17 |
| 18 // Implements ChromeOS specific functionality for ScreenOrientationProvider. |
| 19 class ScreenOrientationDelegate : public content::ScreenOrientationDelegate { |
| 20 public: |
| 21 ScreenOrientationDelegate(); |
| 22 virtual ~ScreenOrientationDelegate(); |
| 23 |
| 24 // content::ScreenOrientationDelegate: |
| 25 virtual bool FullScreenRequired(content::WebContents* web_contents) override; |
| 26 virtual void Lock( |
| 27 blink::WebScreenOrientationLockType lock_orientation) override; |
| 28 virtual bool ScreenOrientationProviderSupported() override; |
| 29 virtual void Unlock() override; |
| 30 |
| 31 private: |
| 32 // Locks rotation to the angle matching the primary orientation for |
| 33 // |lock_orientation|. |
| 34 void LockRotationToPrimaryOrientation( |
| 35 blink::WebScreenOrientationLockType lock_orientation); |
| 36 |
| 37 // Locks rotation to the angle matching the secondary orientation for |
| 38 // |lock_orientation|. |
| 39 void LockRotationToSecondaryOrientation( |
| 40 blink::WebScreenOrientationLockType lock_orientation); |
| 41 |
| 42 // For orientations that do not specify primary or secondary, locks to the |
| 43 // current rotation if it matches |lock_orientation|. Otherwise locks to a |
| 44 // matching rotation. |
| 45 void LockToRotationMatchingOrientation( |
| 46 blink::WebScreenOrientationLockType lock_orientation); |
| 47 |
| 48 // The orientation of the display when at a rotation of 0. |
| 49 blink::WebScreenOrientationLockType natural_orientation_; |
| 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDelegate); |
| 52 }; |
| 53 |
| 54 } // namespace ash |
| 55 |
| 56 #endif // ASH_DISPLAY_SCREEN_ORIENTATION_DELEGATE_CHROMEOS_H_ |
OLD | NEW |