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/display_manager.h" | 5 #include "ash/display/display_manager.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 std::vector<DisplayInfo> new_display_info_list; | 519 std::vector<DisplayInfo> new_display_info_list; |
520 new_display_info_list.push_back( | 520 new_display_info_list.push_back( |
521 GetDisplayInfo(DisplayController::GetPrimaryDisplay())); | 521 GetDisplayInfo(DisplayController::GetPrimaryDisplay())); |
522 // Add if there is only one display. | 522 // Add if there is only one display. |
523 if (displays_.size() == 1) { | 523 if (displays_.size() == 1) { |
524 // Layout the 2nd display below the primary as with the real device. | 524 // Layout the 2nd display below the primary as with the real device. |
525 aura::RootWindow* primary = Shell::GetPrimaryRootWindow(); | 525 aura::RootWindow* primary = Shell::GetPrimaryRootWindow(); |
526 gfx::Rect host_bounds = | 526 gfx::Rect host_bounds = |
527 gfx::Rect(primary->GetHostOrigin(), primary->GetHostSize()); | 527 gfx::Rect(primary->GetHostOrigin(), primary->GetHostSize()); |
528 new_display_info_list.push_back(DisplayInfo::CreateFromSpec( | 528 new_display_info_list.push_back(DisplayInfo::CreateFromSpec( |
529 StringPrintf("%d+%d-500x400", host_bounds.x(), host_bounds.bottom()))); | 529 base::StringPrintf( |
| 530 "%d+%d-500x400", host_bounds.x(), host_bounds.bottom()))); |
530 } | 531 } |
531 UpdateDisplays(new_display_info_list); | 532 UpdateDisplays(new_display_info_list); |
532 } | 533 } |
533 | 534 |
534 void DisplayManager::ScaleDisplayImpl() { | 535 void DisplayManager::ScaleDisplayImpl() { |
535 DCHECK(!displays_.empty()); | 536 DCHECK(!displays_.empty()); |
536 std::vector<DisplayInfo> new_display_info_list; | 537 std::vector<DisplayInfo> new_display_info_list; |
537 for (DisplayList::const_iterator iter = displays_.begin(); | 538 for (DisplayList::const_iterator iter = displays_.begin(); |
538 iter != displays_.end(); ++iter) { | 539 iter != displays_.end(); ++iter) { |
539 DisplayInfo display_info = GetDisplayInfo(*iter); | 540 DisplayInfo display_info = GetDisplayInfo(*iter); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 // always (0,0) and the secondary display's bounds will be updated | 646 // always (0,0) and the secondary display's bounds will be updated |
646 // by |DisplayController::UpdateDisplayBoundsForLayout|. | 647 // by |DisplayController::UpdateDisplayBoundsForLayout|. |
647 new_display.SetScaleAndBounds( | 648 new_display.SetScaleAndBounds( |
648 display_info.device_scale_factor(), gfx::Rect(bounds_in_pixel.size())); | 649 display_info.device_scale_factor(), gfx::Rect(bounds_in_pixel.size())); |
649 new_display.set_rotation(display_info.rotation()); | 650 new_display.set_rotation(display_info.rotation()); |
650 return new_display; | 651 return new_display; |
651 } | 652 } |
652 | 653 |
653 } // namespace internal | 654 } // namespace internal |
654 } // namespace ash | 655 } // namespace ash |
OLD | NEW |