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 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 } | 931 } |
932 | 932 |
933 #if defined(OS_CHROMEOS) | 933 #if defined(OS_CHROMEOS) |
934 void DisplayManager::SetSoftwareMirroring(bool enabled) { | 934 void DisplayManager::SetSoftwareMirroring(bool enabled) { |
935 // TODO(oshima|bshe): Support external display on the system | 935 // TODO(oshima|bshe): Support external display on the system |
936 // that has virtual keyboard display. | 936 // that has virtual keyboard display. |
937 if (second_display_mode_ == VIRTUAL_KEYBOARD) | 937 if (second_display_mode_ == VIRTUAL_KEYBOARD) |
938 return; | 938 return; |
939 SetSecondDisplayMode(enabled ? MIRRORING : EXTENDED); | 939 SetSecondDisplayMode(enabled ? MIRRORING : EXTENDED); |
940 } | 940 } |
| 941 |
| 942 bool DisplayManager::SoftwareMirroringEnabled() const { |
| 943 return software_mirroring_enabled(); |
| 944 } |
941 #endif | 945 #endif |
942 | 946 |
943 void DisplayManager::SetSecondDisplayMode(SecondDisplayMode mode) { | 947 void DisplayManager::SetSecondDisplayMode(SecondDisplayMode mode) { |
944 second_display_mode_ = mode; | 948 second_display_mode_ = mode; |
945 mirrored_display_id_ = gfx::Display::kInvalidDisplayID; | 949 mirrored_display_id_ = gfx::Display::kInvalidDisplayID; |
946 non_desktop_display_ = gfx::Display(); | 950 non_desktop_display_ = gfx::Display(); |
947 } | 951 } |
948 | 952 |
949 bool DisplayManager::UpdateDisplayBounds(int64 display_id, | 953 bool DisplayManager::UpdateDisplayBounds(int64 display_id, |
950 const gfx::Rect& new_bounds) { | 954 const gfx::Rect& new_bounds) { |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 new_secondary_origin.Offset(-secondary_bounds.width(), offset); | 1121 new_secondary_origin.Offset(-secondary_bounds.width(), offset); |
1118 break; | 1122 break; |
1119 } | 1123 } |
1120 gfx::Insets insets = secondary_display->GetWorkAreaInsets(); | 1124 gfx::Insets insets = secondary_display->GetWorkAreaInsets(); |
1121 secondary_display->set_bounds( | 1125 secondary_display->set_bounds( |
1122 gfx::Rect(new_secondary_origin, secondary_bounds.size())); | 1126 gfx::Rect(new_secondary_origin, secondary_bounds.size())); |
1123 secondary_display->UpdateWorkAreaFromInsets(insets); | 1127 secondary_display->UpdateWorkAreaFromInsets(insets); |
1124 } | 1128 } |
1125 | 1129 |
1126 } // namespace ash | 1130 } // namespace ash |
OLD | NEW |