| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/content/screen_orientation_delegate_chromeos.h" | 5 #include "ash/content/screen_orientation_delegate_chromeos.h" |
| 6 | 6 |
| 7 #include "ash/aura/wm_window_aura.h" |
| 7 #include "ash/display/screen_orientation_controller_chromeos.h" | 8 #include "ash/display/screen_orientation_controller_chromeos.h" |
| 8 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 9 #include "content/public/browser/screen_orientation_provider.h" | 10 #include "content/public/browser/screen_orientation_provider.h" |
| 10 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
| 11 | 12 |
| 12 namespace ash { | 13 namespace ash { |
| 13 | 14 |
| 14 ScreenOrientationDelegateChromeos::ScreenOrientationDelegateChromeos() { | 15 ScreenOrientationDelegateChromeos::ScreenOrientationDelegateChromeos() { |
| 15 content::ScreenOrientationProvider::SetDelegate(this); | 16 content::ScreenOrientationProvider::SetDelegate(this); |
| 16 } | 17 } |
| 18 |
| 17 ScreenOrientationDelegateChromeos::~ScreenOrientationDelegateChromeos() { | 19 ScreenOrientationDelegateChromeos::~ScreenOrientationDelegateChromeos() { |
| 18 content::ScreenOrientationProvider::SetDelegate(nullptr); | 20 content::ScreenOrientationProvider::SetDelegate(nullptr); |
| 19 } | 21 } |
| 20 | 22 |
| 21 bool ScreenOrientationDelegateChromeos::FullScreenRequired( | 23 bool ScreenOrientationDelegateChromeos::FullScreenRequired( |
| 22 content::WebContents* web_contents) { | 24 content::WebContents* web_contents) { |
| 23 return true; | 25 return true; |
| 24 } | 26 } |
| 25 | 27 |
| 26 void ScreenOrientationDelegateChromeos::Lock( | 28 void ScreenOrientationDelegateChromeos::Lock( |
| 27 content::WebContents* web_contents, | 29 content::WebContents* web_contents, |
| 28 blink::WebScreenOrientationLockType lock_orientation) { | 30 blink::WebScreenOrientationLockType lock_orientation) { |
| 29 Shell::GetInstance() | 31 Shell::GetInstance() |
| 30 ->screen_orientation_controller() | 32 ->screen_orientation_controller() |
| 31 ->LockOrientationForWindow(web_contents->GetNativeView(), | 33 ->LockOrientationForWindow( |
| 32 lock_orientation); | 34 WmWindowAura::Get(web_contents->GetNativeView()), lock_orientation); |
| 33 } | 35 } |
| 34 | 36 |
| 35 bool ScreenOrientationDelegateChromeos::ScreenOrientationProviderSupported() { | 37 bool ScreenOrientationDelegateChromeos::ScreenOrientationProviderSupported() { |
| 36 return Shell::GetInstance() | 38 return Shell::GetInstance() |
| 37 ->screen_orientation_controller() | 39 ->screen_orientation_controller() |
| 38 ->ScreenOrientationProviderSupported(); | 40 ->ScreenOrientationProviderSupported(); |
| 39 } | 41 } |
| 42 |
| 40 void ScreenOrientationDelegateChromeos::Unlock( | 43 void ScreenOrientationDelegateChromeos::Unlock( |
| 41 content::WebContents* web_contents) { | 44 content::WebContents* web_contents) { |
| 42 Shell::GetInstance() | 45 Shell::GetInstance() |
| 43 ->screen_orientation_controller() | 46 ->screen_orientation_controller() |
| 44 ->UnlockOrientationForWindow(web_contents->GetNativeView()); | 47 ->UnlockOrientationForWindow( |
| 48 WmWindowAura::Get(web_contents->GetNativeView())); |
| 45 } | 49 } |
| 46 | 50 |
| 47 } // namespace ash | 51 } // namespace ash |
| OLD | NEW |