| 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 <cmath> | 7 #include <cmath> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 iter != displays_.end(); ++iter) { | 625 iter != displays_.end(); ++iter) { |
| 626 display_info_list.push_back(GetDisplayInfo(iter->id())); | 626 display_info_list.push_back(GetDisplayInfo(iter->id())); |
| 627 } | 627 } |
| 628 AddMirrorDisplayInfoIfAny(&display_info_list); | 628 AddMirrorDisplayInfoIfAny(&display_info_list); |
| 629 UpdateDisplays(display_info_list); | 629 UpdateDisplays(display_info_list); |
| 630 } | 630 } |
| 631 | 631 |
| 632 void DisplayManager::UpdateDisplays( | 632 void DisplayManager::UpdateDisplays( |
| 633 const std::vector<DisplayInfo>& updated_display_info_list) { | 633 const std::vector<DisplayInfo>& updated_display_info_list) { |
| 634 #if defined(OS_WIN) | 634 #if defined(OS_WIN) |
| 635 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { | 635 DCHECK_EQ(1u, updated_display_info_list.size()) << |
| 636 DCHECK_EQ(1u, updated_display_info_list.size()) << | 636 ": Multiple display test does not work on Windows bots. Please " |
| 637 "Multiple display test does not work on Win8 bots. Please " | 637 "skip (don't disable) the test using SupportsMultipleDisplays()"; |
| 638 "skip (don't disable) the test using SupportsMultipleDisplays()"; | |
| 639 } | |
| 640 #endif | 638 #endif |
| 641 | 639 |
| 642 DisplayInfoList new_display_info_list = updated_display_info_list; | 640 DisplayInfoList new_display_info_list = updated_display_info_list; |
| 643 std::sort(displays_.begin(), displays_.end(), DisplaySortFunctor()); | 641 std::sort(displays_.begin(), displays_.end(), DisplaySortFunctor()); |
| 644 std::sort(new_display_info_list.begin(), | 642 std::sort(new_display_info_list.begin(), |
| 645 new_display_info_list.end(), | 643 new_display_info_list.end(), |
| 646 DisplayInfoSortFunctor()); | 644 DisplayInfoSortFunctor()); |
| 647 DisplayList removed_displays; | 645 DisplayList removed_displays; |
| 648 std::vector<size_t> changed_display_indices; | 646 std::vector<size_t> changed_display_indices; |
| 649 std::vector<size_t> added_display_indices; | 647 std::vector<size_t> added_display_indices; |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1117 new_secondary_origin.Offset(-secondary_bounds.width(), offset); | 1115 new_secondary_origin.Offset(-secondary_bounds.width(), offset); |
| 1118 break; | 1116 break; |
| 1119 } | 1117 } |
| 1120 gfx::Insets insets = secondary_display->GetWorkAreaInsets(); | 1118 gfx::Insets insets = secondary_display->GetWorkAreaInsets(); |
| 1121 secondary_display->set_bounds( | 1119 secondary_display->set_bounds( |
| 1122 gfx::Rect(new_secondary_origin, secondary_bounds.size())); | 1120 gfx::Rect(new_secondary_origin, secondary_bounds.size())); |
| 1123 secondary_display->UpdateWorkAreaFromInsets(insets); | 1121 secondary_display->UpdateWorkAreaFromInsets(insets); |
| 1124 } | 1122 } |
| 1125 | 1123 |
| 1126 } // namespace ash | 1124 } // namespace ash |
| OLD | NEW |