| 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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 for (DisplayList::const_iterator iter = displays_.begin(); | 414 for (DisplayList::const_iterator iter = displays_.begin(); |
| 415 iter != displays_.end(); ++iter) { | 415 iter != displays_.end(); ++iter) { |
| 416 display_info_list.push_back(GetDisplayInfo(iter->id())); | 416 display_info_list.push_back(GetDisplayInfo(iter->id())); |
| 417 } | 417 } |
| 418 AddMirrorDisplayInfoIfAny(&display_info_list); | 418 AddMirrorDisplayInfoIfAny(&display_info_list); |
| 419 UpdateDisplays(display_info_list); | 419 UpdateDisplays(display_info_list); |
| 420 } | 420 } |
| 421 | 421 |
| 422 void DisplayManager::UpdateDisplays( | 422 void DisplayManager::UpdateDisplays( |
| 423 const std::vector<DisplayInfo>& updated_display_info_list) { | 423 const std::vector<DisplayInfo>& updated_display_info_list) { |
| 424 #if defined(OS_WIN) |
| 425 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { |
| 426 DCHECK_EQ(1u, updated_display_info_list.size()) << |
| 427 "Multi display test does not work on Win8 bots. Please " |
| 428 "skip (don't disable) the test using RETURN_IF_WIN8 or " |
| 429 "CONTINUE_IF_WIN8 macro"; |
| 430 } |
| 431 #endif |
| 432 |
| 424 DisplayInfoList new_display_info_list = updated_display_info_list; | 433 DisplayInfoList new_display_info_list = updated_display_info_list; |
| 425 std::sort(displays_.begin(), displays_.end(), DisplaySortFunctor()); | 434 std::sort(displays_.begin(), displays_.end(), DisplaySortFunctor()); |
| 426 std::sort(new_display_info_list.begin(), | 435 std::sort(new_display_info_list.begin(), |
| 427 new_display_info_list.end(), | 436 new_display_info_list.end(), |
| 428 DisplayInfoSortFunctor()); | 437 DisplayInfoSortFunctor()); |
| 429 DisplayList removed_displays; | 438 DisplayList removed_displays; |
| 430 std::vector<size_t> changed_display_indices; | 439 std::vector<size_t> changed_display_indices; |
| 431 std::vector<size_t> added_display_indices; | 440 std::vector<size_t> added_display_indices; |
| 432 | 441 |
| 433 DisplayList::iterator curr_iter = displays_.begin(); | 442 DisplayList::iterator curr_iter = displays_.begin(); |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 // always (0,0) and the secondary display's bounds will be updated | 864 // always (0,0) and the secondary display's bounds will be updated |
| 856 // by |DisplayController::UpdateDisplayBoundsForLayout|. | 865 // by |DisplayController::UpdateDisplayBoundsForLayout|. |
| 857 new_display.SetScaleAndBounds( | 866 new_display.SetScaleAndBounds( |
| 858 display_info.device_scale_factor(), gfx::Rect(bounds_in_pixel.size())); | 867 display_info.device_scale_factor(), gfx::Rect(bounds_in_pixel.size())); |
| 859 new_display.set_rotation(display_info.rotation()); | 868 new_display.set_rotation(display_info.rotation()); |
| 860 return new_display; | 869 return new_display; |
| 861 } | 870 } |
| 862 | 871 |
| 863 } // namespace internal | 872 } // namespace internal |
| 864 } // namespace ash | 873 } // namespace ash |
| OLD | NEW |