| 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/common/wm_window.h" | 7 #include "ash/common/wm_window.h" |
| 8 #include "ash/display/screen_orientation_controller_chromeos.h" | 8 #include "ash/display/screen_orientation_controller_chromeos.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 bool ScreenOrientationDelegateChromeos::FullScreenRequired( | 22 bool ScreenOrientationDelegateChromeos::FullScreenRequired( |
| 23 content::WebContents* web_contents) { | 23 content::WebContents* web_contents) { |
| 24 return true; | 24 return true; |
| 25 } | 25 } |
| 26 | 26 |
| 27 void ScreenOrientationDelegateChromeos::Lock( | 27 void ScreenOrientationDelegateChromeos::Lock( |
| 28 content::WebContents* web_contents, | 28 content::WebContents* web_contents, |
| 29 blink::WebScreenOrientationLockType lock_orientation) { | 29 blink::WebScreenOrientationLockType lock_orientation) { |
| 30 Shell::GetInstance() | 30 Shell::GetInstance() |
| 31 ->screen_orientation_controller() | 31 ->screen_orientation_controller() |
| 32 ->LockOrientationForWindow(WmWindow::Get(web_contents->GetNativeView()), | 32 ->LockOrientationForWindow( |
| 33 lock_orientation); | 33 WmWindow::Get(web_contents->GetNativeView()), lock_orientation, |
| 34 ScreenOrientationController::LockCompletionBehavior::None); |
| 34 } | 35 } |
| 35 | 36 |
| 36 bool ScreenOrientationDelegateChromeos::ScreenOrientationProviderSupported() { | 37 bool ScreenOrientationDelegateChromeos::ScreenOrientationProviderSupported() { |
| 37 return Shell::GetInstance() | 38 return Shell::GetInstance() |
| 38 ->screen_orientation_controller() | 39 ->screen_orientation_controller() |
| 39 ->ScreenOrientationProviderSupported(); | 40 ->ScreenOrientationProviderSupported(); |
| 40 } | 41 } |
| 41 | 42 |
| 42 void ScreenOrientationDelegateChromeos::Unlock( | 43 void ScreenOrientationDelegateChromeos::Unlock( |
| 43 content::WebContents* web_contents) { | 44 content::WebContents* web_contents) { |
| 44 Shell::GetInstance() | 45 Shell::GetInstance() |
| 45 ->screen_orientation_controller() | 46 ->screen_orientation_controller() |
| 46 ->UnlockOrientationForWindow( | 47 ->UnlockOrientationForWindow( |
| 47 WmWindow::Get(web_contents->GetNativeView())); | 48 WmWindow::Get(web_contents->GetNativeView())); |
| 48 } | 49 } |
| 49 | 50 |
| 50 } // namespace ash | 51 } // namespace ash |
| OLD | NEW |