| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |