Chromium Code Reviews| 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_SYSTEM_CHROMEOS_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DELEGATE_ASH_H _ | |
| 6 #define ASH_SYSTEM_CHROMEOS_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DELEGATE_ASH_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 ScreenOrientationDelegateAsh : public content::ScreenOrientationDelegate { | |
| 20 public: | |
| 21 ScreenOrientationDelegateAsh(); | |
| 22 virtual ~ScreenOrientationDelegateAsh(); | |
| 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 | |
|
mlamouri (slow - plz ping)
2014/10/15 15:39:33
nit: no empty line I guess?
jonross
2014/10/22 18:45:30
Done.
| |
| 33 // Locks rotation to the angle matching the primary orientation for | |
| 34 // |lock_orientation|. | |
| 35 void LockRotationToPrimaryOrientation( | |
| 36 blink::WebScreenOrientationLockType lock_orientation); | |
| 37 | |
| 38 // Locks rotation to the angle matching the secondary orientation for | |
| 39 // |lock_orientation|. | |
| 40 void LockRotationToSecondaryOrientation( | |
| 41 blink::WebScreenOrientationLockType lock_orientation); | |
| 42 | |
| 43 // For orientations that do not specify primary or secondary, locks to the | |
| 44 // current rotation if it matches |lock_orientation|. Otherwise locks to a | |
| 45 // matching rotation. | |
| 46 void LockToRotationMatchingOrientation( | |
| 47 blink::WebScreenOrientationLockType lock_orientation); | |
| 48 | |
| 49 // The orientation of the display when at a rotation of 0. | |
| 50 blink::WebScreenOrientationLockType natural_orientation_; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDelegateAsh); | |
| 53 }; | |
| 54 | |
| 55 } // namespace ash | |
| 56 | |
| 57 #endif // ASH_SYSTEM_CHROMEOS_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DELEGATE_AS H_H_ | |
| OLD | NEW |