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_delegate_chromeos.h" | 5 #include "ash/content/display/screen_orientation_delegate_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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 break; | 112 break; |
113 default: | 113 default: |
114 NOTREACHED(); | 114 NOTREACHED(); |
115 break; | 115 break; |
116 } | 116 } |
117 } | 117 } |
118 | 118 |
119 bool ScreenOrientationDelegate::ScreenOrientationProviderSupported() { | 119 bool ScreenOrientationDelegate::ScreenOrientationProviderSupported() { |
120 return Shell::GetInstance() | 120 return Shell::GetInstance() |
121 ->maximize_mode_controller() | 121 ->maximize_mode_controller() |
122 ->IsMaximizeModeWindowManagerEnabled() && | 122 ->IsMaximizeModeWindowManagerEnabled(); |
123 CommandLine::ForCurrentProcess()->HasSwitch( | |
124 switches::kAshEnableTouchViewTesting); | |
125 } | 123 } |
126 | 124 |
127 void ScreenOrientationDelegate::Unlock(content::WebContents* web_contents) { | 125 void ScreenOrientationDelegate::Unlock(content::WebContents* web_contents) { |
128 aura::Window* requesting_window = web_contents->GetNativeView(); | 126 aura::Window* requesting_window = web_contents->GetNativeView(); |
129 if (requesting_window != locking_window_) | 127 if (requesting_window != locking_window_) |
130 return; | 128 return; |
131 locking_window_ = NULL; | 129 locking_window_ = NULL; |
132 Shell::GetInstance()->maximize_mode_controller()->SetRotationLocked(false); | 130 Shell::GetInstance()->maximize_mode_controller()->SetRotationLocked(false); |
133 } | 131 } |
134 | 132 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 if (rotation == gfx::Display::ROTATE_90 || | 169 if (rotation == gfx::Display::ROTATE_90 || |
172 rotation == gfx::Display::ROTATE_270) { | 170 rotation == gfx::Display::ROTATE_270) { |
173 controller->SetRotationLocked(true); | 171 controller->SetRotationLocked(true); |
174 } else { | 172 } else { |
175 controller->LockRotation(gfx::Display::ROTATE_90); | 173 controller->LockRotation(gfx::Display::ROTATE_90); |
176 } | 174 } |
177 } | 175 } |
178 } | 176 } |
179 | 177 |
180 } // namespace ash | 178 } // namespace ash |
OLD | NEW |