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

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

Issue 2804523002: Fix mistmached |GetDisplayNearest{Window,View}| param type (Closed)
Patch Set: window Created 3 years, 8 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/mus/screen_mus.cc ('k') | no next file » | 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/common/system/tray/actionable_view.h" 7 #include "ash/common/system/tray/actionable_view.h"
8 #include "ash/common/system/tray/system_tray.h" 8 #include "ash/common/system/tray/system_tray.h"
9 #include "ash/common/system/tray/tray_constants.h" 9 #include "ash/common/system/tray/tray_constants.h"
10 #include "ash/common/system/tray/tray_popup_item_style.h" 10 #include "ash/common/system/tray/tray_popup_item_style.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 bool TrayRotationLock::GetInitialVisibility() { 196 bool TrayRotationLock::GetInitialVisibility() {
197 return ShouldBeVisible(); 197 return ShouldBeVisible();
198 } 198 }
199 199
200 bool TrayRotationLock::ShouldBeVisible() { 200 bool TrayRotationLock::ShouldBeVisible() {
201 return OnPrimaryDisplay() && IsMaximizeModeWindowManagerEnabled() && 201 return OnPrimaryDisplay() && IsMaximizeModeWindowManagerEnabled() &&
202 IsUserRotationLocked(); 202 IsUserRotationLocked();
203 } 203 }
204 204
205 bool TrayRotationLock::OnPrimaryDisplay() const { 205 bool TrayRotationLock::OnPrimaryDisplay() const {
206 gfx::NativeView native_view = system_tray()->GetWidget()->GetNativeView(); 206 gfx::NativeView native_window = system_tray()->GetWidget()->GetNativeWindow();
207 display::Display parent_display = 207 display::Display parent_display =
208 display::Screen::GetScreen()->GetDisplayNearestWindow(native_view); 208 display::Screen::GetScreen()->GetDisplayNearestWindow(native_window);
209 return parent_display.IsInternal(); 209 return parent_display.IsInternal();
210 } 210 }
211 211
212 void TrayRotationLock::StopObservingRotation() { 212 void TrayRotationLock::StopObservingRotation() {
213 ScreenOrientationController* controller = 213 ScreenOrientationController* controller =
214 Shell::GetInstance()->screen_orientation_controller(); 214 Shell::GetInstance()->screen_orientation_controller();
215 if (controller) 215 if (controller)
216 controller->RemoveObserver(this); 216 controller->RemoveObserver(this);
217 } 217 }
218 218
219 } // namespace ash 219 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/screen_mus.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698