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

Side by Side Diff: ash/system/chromeos/rotation/tray_rotation_lock.cc

Issue 1608053002: Remove now-unnecessary wrappers around gfx::Screen::GetScreen() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-5
Patch Set: cros Created 4 years, 11 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/system/audio/tray_audio.cc ('k') | ash/system/chromeos/tray_display.cc » ('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/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
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
OLDNEW
« no previous file with comments | « ash/system/audio/tray_audio.cc ('k') | ash/system/chromeos/tray_display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698