OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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/display/screen_orientation_controller_chromeos.h" | 5 #include "ash/content/display/screen_orientation_controller_chromeos.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/display/display_info.h" | 8 #include "ash/display/display_info.h" |
9 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 requesting_window->AddObserver(this); | 176 requesting_window->AddObserver(this); |
177 locking_windows_[requesting_window] = lock_orientation; | 177 locking_windows_[requesting_window] = lock_orientation; |
178 | 178 |
179 ApplyLockForActiveWindow(); | 179 ApplyLockForActiveWindow(); |
180 } | 180 } |
181 | 181 |
182 bool ScreenOrientationController::ScreenOrientationProviderSupported() { | 182 bool ScreenOrientationController::ScreenOrientationProviderSupported() { |
183 return Shell::GetInstance() | 183 return Shell::GetInstance() |
184 ->maximize_mode_controller() | 184 ->maximize_mode_controller() |
185 ->IsMaximizeModeWindowManagerEnabled() && | 185 ->IsMaximizeModeWindowManagerEnabled() && |
186 base::CommandLine::ForCurrentProcess()->HasSwitch( | 186 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
187 switches::kAshEnableTouchViewTesting); | 187 switches::kAshDisableScreenOrientationLock); |
188 } | 188 } |
189 | 189 |
190 void ScreenOrientationController::Unlock(content::WebContents* web_contents) { | 190 void ScreenOrientationController::Unlock(content::WebContents* web_contents) { |
191 aura::Window* requesting_window = web_contents->GetNativeView(); | 191 aura::Window* requesting_window = web_contents->GetNativeView(); |
192 RemoveLockingWindow(requesting_window); | 192 RemoveLockingWindow(requesting_window); |
193 } | 193 } |
194 | 194 |
195 void ScreenOrientationController::OnDisplayConfigurationChanged() { | 195 void ScreenOrientationController::OnDisplayConfigurationChanged() { |
196 if (ignore_display_configuration_updates_) | 196 if (ignore_display_configuration_updates_) |
197 return; | 197 return; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 } | 413 } |
414 | 414 |
415 bool ScreenOrientationController::CanRotateInLockedState() { | 415 bool ScreenOrientationController::CanRotateInLockedState() { |
416 return rotation_locked_orientation_ == | 416 return rotation_locked_orientation_ == |
417 blink::WebScreenOrientationLockLandscape || | 417 blink::WebScreenOrientationLockLandscape || |
418 rotation_locked_orientation_ == | 418 rotation_locked_orientation_ == |
419 blink::WebScreenOrientationLockPortrait; | 419 blink::WebScreenOrientationLockPortrait; |
420 } | 420 } |
421 | 421 |
422 } // namespace ash | 422 } // namespace ash |
OLD | NEW |