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 DCHECK_EQ(1u, updated_display_info_list.size()) << | 635 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { |
636 ": Multiple display test does not work on Windows bots. Please " | 636 DCHECK_EQ(1u, updated_display_info_list.size()) << |
637 "skip (don't disable) the test using SupportsMultipleDisplays()"; | 637 "Multiple display test does not work on Win8 bots. Please " |
| 638 "skip (don't disable) the test using SupportsMultipleDisplays()"; |
| 639 } |
638 #endif | 640 #endif |
639 | 641 |
640 DisplayInfoList new_display_info_list = updated_display_info_list; | 642 DisplayInfoList new_display_info_list = updated_display_info_list; |
641 std::sort(displays_.begin(), displays_.end(), DisplaySortFunctor()); | 643 std::sort(displays_.begin(), displays_.end(), DisplaySortFunctor()); |
642 std::sort(new_display_info_list.begin(), | 644 std::sort(new_display_info_list.begin(), |
643 new_display_info_list.end(), | 645 new_display_info_list.end(), |
644 DisplayInfoSortFunctor()); | 646 DisplayInfoSortFunctor()); |
645 DisplayList removed_displays; | 647 DisplayList removed_displays; |
646 std::vector<size_t> changed_display_indices; | 648 std::vector<size_t> changed_display_indices; |
647 std::vector<size_t> added_display_indices; | 649 std::vector<size_t> added_display_indices; |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1115 new_secondary_origin.Offset(-secondary_bounds.width(), offset); | 1117 new_secondary_origin.Offset(-secondary_bounds.width(), offset); |
1116 break; | 1118 break; |
1117 } | 1119 } |
1118 gfx::Insets insets = secondary_display->GetWorkAreaInsets(); | 1120 gfx::Insets insets = secondary_display->GetWorkAreaInsets(); |
1119 secondary_display->set_bounds( | 1121 secondary_display->set_bounds( |
1120 gfx::Rect(new_secondary_origin, secondary_bounds.size())); | 1122 gfx::Rect(new_secondary_origin, secondary_bounds.size())); |
1121 secondary_display->UpdateWorkAreaFromInsets(insets); | 1123 secondary_display->UpdateWorkAreaFromInsets(insets); |
1122 } | 1124 } |
1123 | 1125 |
1124 } // namespace ash | 1126 } // namespace ash |
OLD | NEW |