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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 AddMirrorDisplayInfoIfAny(&display_info_list); | 412 AddMirrorDisplayInfoIfAny(&display_info_list); |
413 UpdateDisplays(display_info_list); | 413 UpdateDisplays(display_info_list); |
414 } | 414 } |
415 | 415 |
416 void DisplayManager::UpdateDisplays( | 416 void DisplayManager::UpdateDisplays( |
417 const std::vector<DisplayInfo>& updated_display_info_list) { | 417 const std::vector<DisplayInfo>& updated_display_info_list) { |
418 #if defined(OS_WIN) | 418 #if defined(OS_WIN) |
419 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { | 419 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { |
420 DCHECK_EQ(1u, updated_display_info_list.size()) << | 420 DCHECK_EQ(1u, updated_display_info_list.size()) << |
421 "Multiple display test does not work on Win8 bots. Please " | 421 "Multiple display test does not work on Win8 bots. Please " |
422 "skip (don't disable) the test using |SupportMultipleDisplay()|"; | 422 "skip (don't disable) the test using SupportsMultipleDisplays()"; |
423 } | 423 } |
424 #endif | 424 #endif |
425 | 425 |
426 DisplayInfoList new_display_info_list = updated_display_info_list; | 426 DisplayInfoList new_display_info_list = updated_display_info_list; |
427 std::sort(displays_.begin(), displays_.end(), DisplaySortFunctor()); | 427 std::sort(displays_.begin(), displays_.end(), DisplaySortFunctor()); |
428 std::sort(new_display_info_list.begin(), | 428 std::sort(new_display_info_list.begin(), |
429 new_display_info_list.end(), | 429 new_display_info_list.end(), |
430 DisplayInfoSortFunctor()); | 430 DisplayInfoSortFunctor()); |
431 DisplayList removed_displays; | 431 DisplayList removed_displays; |
432 std::vector<size_t> changed_display_indices; | 432 std::vector<size_t> changed_display_indices; |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 // always (0,0) and the secondary display's bounds will be updated | 858 // always (0,0) and the secondary display's bounds will be updated |
859 // by |DisplayController::UpdateDisplayBoundsForLayout|. | 859 // by |DisplayController::UpdateDisplayBoundsForLayout|. |
860 new_display.SetScaleAndBounds( | 860 new_display.SetScaleAndBounds( |
861 display_info.device_scale_factor(), gfx::Rect(bounds_in_pixel.size())); | 861 display_info.device_scale_factor(), gfx::Rect(bounds_in_pixel.size())); |
862 new_display.set_rotation(display_info.rotation()); | 862 new_display.set_rotation(display_info.rotation()); |
863 return new_display; | 863 return new_display; |
864 } | 864 } |
865 | 865 |
866 } // namespace internal | 866 } // namespace internal |
867 } // namespace ash | 867 } // namespace ash |
OLD | NEW |