| 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 "ui/display/manager/display_manager.h" | 5 #include "ui/display/manager/display_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 const DisplayLayout& layout = | 690 const DisplayLayout& layout = |
| 691 layout_store_->GetRegisteredDisplayLayout(list); | 691 layout_store_->GetRegisteredDisplayLayout(list); |
| 692 current_default_multi_display_mode_ = | 692 current_default_multi_display_mode_ = |
| 693 (layout.default_unified && unified_desktop_enabled_) ? UNIFIED | 693 (layout.default_unified && unified_desktop_enabled_) ? UNIFIED |
| 694 : EXTENDED; | 694 : EXTENDED; |
| 695 } | 695 } |
| 696 | 696 |
| 697 if (multi_display_mode_ != MIRRORING) | 697 if (multi_display_mode_ != MIRRORING) |
| 698 multi_display_mode_ = current_default_multi_display_mode_; | 698 multi_display_mode_ = current_default_multi_display_mode_; |
| 699 | 699 |
| 700 CreateSoftwareMirroringDisplayInfo(&new_display_info_list); | |
| 701 | |
| 702 // Close the mirroring window if any here to avoid creating two compositor on | 700 // Close the mirroring window if any here to avoid creating two compositor on |
| 703 // one display. | 701 // one display. |
| 704 if (delegate_) | 702 if (delegate_) |
| 705 delegate_->CloseMirroringDisplayIfNotNecessary(); | 703 delegate_->CloseMirroringDisplayIfNotNecessary(); |
| 706 | 704 |
| 705 CreateSoftwareMirroringDisplayInfo(&new_display_info_list); |
| 706 |
| 707 Displays new_displays; | 707 Displays new_displays; |
| 708 Displays removed_displays; | 708 Displays removed_displays; |
| 709 std::map<size_t, uint32_t> display_changes; | 709 std::map<size_t, uint32_t> display_changes; |
| 710 std::vector<size_t> added_display_indices; | 710 std::vector<size_t> added_display_indices; |
| 711 | 711 |
| 712 Displays::iterator curr_iter = active_display_list_.begin(); | 712 Displays::iterator curr_iter = active_display_list_.begin(); |
| 713 DisplayInfoList::const_iterator new_info_iter = new_display_info_list.begin(); | 713 DisplayInfoList::const_iterator new_info_iter = new_display_info_list.begin(); |
| 714 | 714 |
| 715 while (curr_iter != active_display_list_.end() || | 715 while (curr_iter != active_display_list_.end() || |
| 716 new_info_iter != new_display_info_list.end()) { | 716 new_info_iter != new_display_info_list.end()) { |
| (...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1499 } | 1499 } |
| 1500 | 1500 |
| 1501 const Display& DisplayManager::GetSecondaryDisplay() const { | 1501 const Display& DisplayManager::GetSecondaryDisplay() const { |
| 1502 CHECK_LE(2U, GetNumDisplays()); | 1502 CHECK_LE(2U, GetNumDisplays()); |
| 1503 return GetDisplayAt(0).id() == Screen::GetScreen()->GetPrimaryDisplay().id() | 1503 return GetDisplayAt(0).id() == Screen::GetScreen()->GetPrimaryDisplay().id() |
| 1504 ? GetDisplayAt(1) | 1504 ? GetDisplayAt(1) |
| 1505 : GetDisplayAt(0); | 1505 : GetDisplayAt(0); |
| 1506 } | 1506 } |
| 1507 | 1507 |
| 1508 } // namespace display | 1508 } // namespace display |
| OLD | NEW |