OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/multi_display_manager.h" | 5 #include "ash/display/multi_display_manager.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/display/display_controller.h" | 10 #include "ash/display/display_controller.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 DLOG(FATAL) << "Could not find display by id:" << id; | 271 DLOG(FATAL) << "Could not find display by id:" << id; |
272 return GetInvalidDisplay(); | 272 return GetInvalidDisplay(); |
273 } | 273 } |
274 | 274 |
275 void MultiDisplayManager::AddDisplayFromSpec(const std::string& spec) { | 275 void MultiDisplayManager::AddDisplayFromSpec(const std::string& spec) { |
276 gfx::Display display = CreateDisplayFromSpec(spec); | 276 gfx::Display display = CreateDisplayFromSpec(spec); |
277 | 277 |
278 if (DisplayController::IsExtendedDesktopEnabled()) { | 278 if (DisplayController::IsExtendedDesktopEnabled()) { |
279 const gfx::Insets insets = display.GetWorkAreaInsets(); | 279 const gfx::Insets insets = display.GetWorkAreaInsets(); |
280 const gfx::Rect& native_bounds = display.bounds_in_pixel(); | 280 const gfx::Rect& native_bounds = display.bounds_in_pixel(); |
281 display.set_bounds( | 281 display.SetScaleAndBounds(display.device_scale_factor(), native_bounds); |
282 gfx::Rect(native_bounds.origin(), display.bounds().size())); | |
283 display.UpdateWorkAreaFromInsets(insets); | 282 display.UpdateWorkAreaFromInsets(insets); |
284 } | 283 } |
285 displays_.push_back(display); | 284 displays_.push_back(display); |
286 } | 285 } |
287 | 286 |
288 } // namespace internal | 287 } // namespace internal |
289 } // namespace ash | 288 } // namespace ash |
OLD | NEW |