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

Side by Side Diff: ash/display/screen_ash.cc

Issue 657583003: Chrome OS: Ash support for >=3 displays. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased at 306637. Created 6 years 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
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/display/screen_ash.h" 5 #include "ash/display/screen_ash.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/display/display_manager.h" 8 #include "ash/display/display_manager.h"
9 #include "ash/root_window_controller.h" 9 #include "ash/root_window_controller.h"
10 #include "ash/root_window_settings.h" 10 #include "ash/root_window_settings.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 const gfx::Rect& rect) { 154 const gfx::Rect& rect) {
155 gfx::Point point = rect.origin(); 155 gfx::Point point = rect.origin();
156 aura::client::GetScreenPositionClient(window->GetRootWindow())-> 156 aura::client::GetScreenPositionClient(window->GetRootWindow())->
157 ConvertPointFromScreen(window, &point); 157 ConvertPointFromScreen(window, &point);
158 return gfx::Rect(point, rect.size()); 158 return gfx::Rect(point, rect.size());
159 } 159 }
160 160
161 // static 161 // static
162 const gfx::Display& ScreenAsh::GetSecondaryDisplay() { 162 const gfx::Display& ScreenAsh::GetSecondaryDisplay() {
163 DisplayManager* display_manager = GetDisplayManager(); 163 DisplayManager* display_manager = GetDisplayManager();
164 CHECK_EQ(2U, display_manager->GetNumDisplays()); 164 CHECK_LE(2U, display_manager->GetNumDisplays());
165 return display_manager->GetDisplayAt(0).id() == 165 return display_manager->GetDisplayAt(0).id() ==
166 Shell::GetScreen()->GetPrimaryDisplay().id() ? 166 Shell::GetScreen()->GetPrimaryDisplay().id() ?
167 display_manager->GetDisplayAt(1) : display_manager->GetDisplayAt(0); 167 display_manager->GetDisplayAt(1) : display_manager->GetDisplayAt(0);
168 } 168 }
169 169
170 // static 170 // static
171 const gfx::Display& ScreenAsh::GetDisplayForId(int64 display_id) { 171 const gfx::Display& ScreenAsh::GetDisplayForId(int64 display_id) {
172 return GetDisplayManager()->GetDisplayForId(display_id); 172 return GetDisplayManager()->GetDisplayForId(display_id);
173 } 173 }
174 174
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 260
261 void ScreenAsh::RemoveObserver(gfx::DisplayObserver* observer) { 261 void ScreenAsh::RemoveObserver(gfx::DisplayObserver* observer) {
262 observers_.RemoveObserver(observer); 262 observers_.RemoveObserver(observer);
263 } 263 }
264 264
265 gfx::Screen* ScreenAsh::CloneForShutdown() { 265 gfx::Screen* ScreenAsh::CloneForShutdown() {
266 return new ScreenForShutdown(this); 266 return new ScreenForShutdown(this);
267 } 267 }
268 268
269 } // namespace ash 269 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698