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 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 124 switches::kAshEnableTouchViewTesting); |
123 } | 125 } |
124 | 126 |
125 void ScreenOrientationDelegate::Unlock(content::WebContents* web_contents) { | 127 void ScreenOrientationDelegate::Unlock(content::WebContents* web_contents) { |
126 aura::Window* requesting_window = web_contents->GetNativeView(); | 128 aura::Window* requesting_window = web_contents->GetNativeView(); |
127 if (requesting_window != locking_window_) | 129 if (requesting_window != locking_window_) |
128 return; | 130 return; |
129 locking_window_ = NULL; | 131 locking_window_ = NULL; |
130 Shell::GetInstance()->maximize_mode_controller()->SetRotationLocked(false); | 132 Shell::GetInstance()->maximize_mode_controller()->SetRotationLocked(false); |
131 } | 133 } |
132 | 134 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 if (rotation == gfx::Display::ROTATE_90 || | 171 if (rotation == gfx::Display::ROTATE_90 || |
170 rotation == gfx::Display::ROTATE_270) { | 172 rotation == gfx::Display::ROTATE_270) { |
171 controller->SetRotationLocked(true); | 173 controller->SetRotationLocked(true); |
172 } else { | 174 } else { |
173 controller->LockRotation(gfx::Display::ROTATE_90); | 175 controller->LockRotation(gfx::Display::ROTATE_90); |
174 } | 176 } |
175 } | 177 } |
176 } | 178 } |
177 | 179 |
178 } // namespace ash | 180 } // namespace ash |
OLD | NEW |