Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: ash/content/display/screen_orientation_controller_chromeos.cc

Issue 901963002: Enable ScreenOrientation API by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/ash_switches.cc ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/ash_switches.cc ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698