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 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 | 831 |
832 size_t DisplayManager::GetNumDisplays() const { | 832 size_t DisplayManager::GetNumDisplays() const { |
833 return displays_.size(); | 833 return displays_.size(); |
834 } | 834 } |
835 | 835 |
836 bool DisplayManager::IsMirrored() const { | 836 bool DisplayManager::IsMirrored() const { |
837 return mirrored_display_id_ != gfx::Display::kInvalidDisplayID; | 837 return mirrored_display_id_ != gfx::Display::kInvalidDisplayID; |
838 } | 838 } |
839 | 839 |
840 const DisplayInfo& DisplayManager::GetDisplayInfo(int64 display_id) const { | 840 const DisplayInfo& DisplayManager::GetDisplayInfo(int64 display_id) const { |
841 DCHECK_NE(gfx::Display::kInvalidDisplayID, display_id); | |
842 | |
843 std::map<int64, DisplayInfo>::const_iterator iter = | 841 std::map<int64, DisplayInfo>::const_iterator iter = |
844 display_info_.find(display_id); | 842 display_info_.find(display_id); |
845 CHECK(iter != display_info_.end()) << display_id; | 843 CHECK(iter != display_info_.end()) << display_id; |
846 return iter->second; | 844 return iter->second; |
847 } | 845 } |
848 | 846 |
849 std::string DisplayManager::GetDisplayNameForId(int64 id) { | 847 std::string DisplayManager::GetDisplayNameForId(int64 id) { |
850 if (id == gfx::Display::kInvalidDisplayID) | 848 if (id == gfx::Display::kInvalidDisplayID) |
851 return l10n_util::GetStringUTF8(IDS_ASH_STATUS_TRAY_UNKNOWN_DISPLAY_NAME); | 849 return l10n_util::GetStringUTF8(IDS_ASH_STATUS_TRAY_UNKNOWN_DISPLAY_NAME); |
852 | 850 |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 new_secondary_origin.Offset(-secondary_bounds.width(), offset); | 1115 new_secondary_origin.Offset(-secondary_bounds.width(), offset); |
1118 break; | 1116 break; |
1119 } | 1117 } |
1120 gfx::Insets insets = secondary_display->GetWorkAreaInsets(); | 1118 gfx::Insets insets = secondary_display->GetWorkAreaInsets(); |
1121 secondary_display->set_bounds( | 1119 secondary_display->set_bounds( |
1122 gfx::Rect(new_secondary_origin, secondary_bounds.size())); | 1120 gfx::Rect(new_secondary_origin, secondary_bounds.size())); |
1123 secondary_display->UpdateWorkAreaFromInsets(insets); | 1121 secondary_display->UpdateWorkAreaFromInsets(insets); |
1124 } | 1122 } |
1125 | 1123 |
1126 } // namespace ash | 1124 } // namespace ash |
OLD | NEW |