| 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 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 | 891 |
| 892 gfx::Display new_display(display_info.id()); | 892 gfx::Display new_display(display_info.id()); |
| 893 gfx::Rect bounds_in_native(display_info.size_in_pixel()); | 893 gfx::Rect bounds_in_native(display_info.size_in_pixel()); |
| 894 | 894 |
| 895 // Simply set the origin to (0,0). The primary display's origin is | 895 // Simply set the origin to (0,0). The primary display's origin is |
| 896 // always (0,0) and the secondary display's bounds will be updated | 896 // always (0,0) and the secondary display's bounds will be updated |
| 897 // in |UpdateSecondaryDisplayBoundsForLayout| called in |UpdateDisplay|. | 897 // in |UpdateSecondaryDisplayBoundsForLayout| called in |UpdateDisplay|. |
| 898 new_display.SetScaleAndBounds( | 898 new_display.SetScaleAndBounds( |
| 899 display_info.device_scale_factor(), gfx::Rect(bounds_in_native.size())); | 899 display_info.device_scale_factor(), gfx::Rect(bounds_in_native.size())); |
| 900 new_display.set_rotation(display_info.rotation()); | 900 new_display.set_rotation(display_info.rotation()); |
| 901 new_display.set_touch_support(display_info.touch_support()); |
| 901 return new_display; | 902 return new_display; |
| 902 } | 903 } |
| 903 | 904 |
| 904 bool DisplayManager::UpdateSecondaryDisplayBoundsForLayout( | 905 bool DisplayManager::UpdateSecondaryDisplayBoundsForLayout( |
| 905 DisplayList* displays, | 906 DisplayList* displays, |
| 906 size_t* updated_index) const { | 907 size_t* updated_index) const { |
| 907 if (displays->size() != 2U) | 908 if (displays->size() != 2U) |
| 908 return false; | 909 return false; |
| 909 | 910 |
| 910 int64 id_at_zero = displays->at(0).id(); | 911 int64 id_at_zero = displays->at(0).id(); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 break; | 983 break; |
| 983 } | 984 } |
| 984 gfx::Insets insets = secondary_display->GetWorkAreaInsets(); | 985 gfx::Insets insets = secondary_display->GetWorkAreaInsets(); |
| 985 secondary_display->set_bounds( | 986 secondary_display->set_bounds( |
| 986 gfx::Rect(new_secondary_origin, secondary_bounds.size())); | 987 gfx::Rect(new_secondary_origin, secondary_bounds.size())); |
| 987 secondary_display->UpdateWorkAreaFromInsets(insets); | 988 secondary_display->UpdateWorkAreaFromInsets(insets); |
| 988 } | 989 } |
| 989 | 990 |
| 990 } // namespace internal | 991 } // namespace internal |
| 991 } // namespace ash | 992 } // namespace ash |
| OLD | NEW |