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