| 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/system/chromeos/rotation/tray_rotation_lock.h" | 5 #include "ash/system/chromeos/rotation/tray_rotation_lock.h" |
| 6 | 6 |
| 7 #include "ash/display/screen_orientation_controller_chromeos.h" | 7 #include "ash/display/screen_orientation_controller_chromeos.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/system/tray/system_tray.h" | 9 #include "ash/system/tray/system_tray.h" |
| 10 #include "ash/system/tray/tray_item_more.h" | 10 #include "ash/system/tray/tray_item_more.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 ->maximize_mode_controller() | 143 ->maximize_mode_controller() |
| 144 ->IsMaximizeModeWindowManagerEnabled() && | 144 ->IsMaximizeModeWindowManagerEnabled() && |
| 145 Shell::GetInstance() | 145 Shell::GetInstance() |
| 146 ->screen_orientation_controller() | 146 ->screen_orientation_controller() |
| 147 ->rotation_locked(); | 147 ->rotation_locked(); |
| 148 } | 148 } |
| 149 | 149 |
| 150 bool TrayRotationLock::OnPrimaryDisplay() const { | 150 bool TrayRotationLock::OnPrimaryDisplay() const { |
| 151 gfx::NativeView native_view = system_tray()->GetWidget()->GetNativeView(); | 151 gfx::NativeView native_view = system_tray()->GetWidget()->GetNativeView(); |
| 152 gfx::Display parent_display = | 152 gfx::Display parent_display = |
| 153 Shell::GetScreen()->GetDisplayNearestWindow(native_view); | 153 gfx::Screen::GetScreen()->GetDisplayNearestWindow(native_view); |
| 154 return parent_display.IsInternal(); | 154 return parent_display.IsInternal(); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void TrayRotationLock::StopObservingRotation() { | 157 void TrayRotationLock::StopObservingRotation() { |
| 158 if (!observing_rotation_) | 158 if (!observing_rotation_) |
| 159 return; | 159 return; |
| 160 ScreenOrientationController* controller = | 160 ScreenOrientationController* controller = |
| 161 Shell::GetInstance()->screen_orientation_controller(); | 161 Shell::GetInstance()->screen_orientation_controller(); |
| 162 if (controller) | 162 if (controller) |
| 163 controller->RemoveObserver(this); | 163 controller->RemoveObserver(this); |
| 164 observing_rotation_ = false; | 164 observing_rotation_ = false; |
| 165 } | 165 } |
| 166 | 166 |
| 167 void TrayRotationLock::StopObservingShell() { | 167 void TrayRotationLock::StopObservingShell() { |
| 168 if (!observing_shell_) | 168 if (!observing_shell_) |
| 169 return; | 169 return; |
| 170 Shell::GetInstance()->RemoveShellObserver(this); | 170 Shell::GetInstance()->RemoveShellObserver(this); |
| 171 observing_shell_ = false; | 171 observing_shell_ = false; |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace ash | 174 } // namespace ash |
| OLD | NEW |