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_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 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 virtual bool FullScreenRequired(content::WebContents* web_contents) override; | |
| 30 virtual bool Lock( | |
| 31 content::WebContents* web_contents, | |
| 32 blink::WebScreenOrientationLockType lock_orientation) override; | |
| 33 virtual bool ScreenOrientationProviderSupported() override; | |
| 34 virtual void Unlock(content::WebContents* web_contents) override; | |
|
mlamouri (slow - plz ping)
2014/11/01 00:30:40
I think you can remove |virtual| from those method
jonross
2014/11/03 18:22:03
Done.
| |
| 35 | |
| 36 private: | |
| 37 // Locks rotation to the angle matching the primary orientation for | |
| 38 // |lock_orientation|. | |
| 39 void LockRotationToPrimaryOrientation( | |
| 40 blink::WebScreenOrientationLockType lock_orientation); | |
| 41 | |
| 42 // Locks rotation to the angle matching the secondary orientation for | |
| 43 // |lock_orientation|. | |
| 44 void LockRotationToSecondaryOrientation( | |
| 45 blink::WebScreenOrientationLockType lock_orientation); | |
| 46 | |
| 47 // For orientations that do not specify primary or secondary, locks to the | |
| 48 // current rotation if it matches |lock_orientation|. Otherwise locks to a | |
| 49 // matching rotation. | |
| 50 void LockToRotationMatchingOrientation( | |
| 51 blink::WebScreenOrientationLockType lock_orientation); | |
| 52 | |
| 53 // The window that has applied the current lock. No other window can apply a | |
| 54 // lock until the current window unlocks rotation. | |
| 55 aura::Window* locking_window_; | |
| 56 | |
| 57 // The orientation of the display when at a rotation of 0. | |
| 58 blink::WebScreenOrientationLockType natural_orientation_; | |
| 59 | |
| 60 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDelegate); | |
| 61 }; | |
| 62 | |
| 63 } // namespace ash | |
| 64 | |
| 65 #endif // ASH_DISPLAY_SCREEN_ORIENTATION_DELEGATE_CHROMEOS_H_ | |
| OLD | NEW |