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