| 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/multi_display_manager.h" | 5 #include "ash/display/multi_display_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/display/display_controller.h" | 10 #include "ash/display/display_controller.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 bounds.Inset(old_insets.Scale(-iter->device_scale_factor())); | 155 bounds.Inset(old_insets.Scale(-iter->device_scale_factor())); |
| 156 iter->SetScaleAndBounds(iter->device_scale_factor(), bounds); | 156 iter->SetScaleAndBounds(iter->device_scale_factor(), bounds); |
| 157 break; | 157 break; |
| 158 } | 158 } |
| 159 } | 159 } |
| 160 } | 160 } |
| 161 overscan_mapping_[display_id] = insets_in_dip; | 161 overscan_mapping_[display_id] = insets_in_dip; |
| 162 OnNativeDisplaysChanged(displays); | 162 OnNativeDisplaysChanged(displays); |
| 163 } | 163 } |
| 164 | 164 |
| 165 gfx::Insets MultiDisplayManager::GetOverscanInsets(int64 display_id) { |
| 166 std::map<int64, gfx::Insets>::const_iterator it = |
| 167 overscan_mapping_.find(display_id); |
| 168 return (it != overscan_mapping_.end()) ? it->second : gfx::Insets(); |
| 169 } |
| 170 |
| 165 void MultiDisplayManager::OnNativeDisplaysChanged( | 171 void MultiDisplayManager::OnNativeDisplaysChanged( |
| 166 const std::vector<gfx::Display>& updated_displays) { | 172 const std::vector<gfx::Display>& updated_displays) { |
| 167 if (updated_displays.empty()) { | 173 if (updated_displays.empty()) { |
| 168 // Don't update the displays when all displays are disconnected. | 174 // Don't update the displays when all displays are disconnected. |
| 169 // This happens when: | 175 // This happens when: |
| 170 // - the device is idle and powerd requested to turn off all displays. | 176 // - the device is idle and powerd requested to turn off all displays. |
| 171 // - the device is suspended. (kernel turns off all displays) | 177 // - the device is suspended. (kernel turns off all displays) |
| 172 // - the internal display's brightness is set to 0 and no external | 178 // - the internal display's brightness is set to 0 and no external |
| 173 // display is connected. | 179 // display is connected. |
| 174 // - the internal display's brightness is 0 and external display is | 180 // - the internal display's brightness is 0 and external display is |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 DisplayList::iterator iter_to_update = to_update->begin(); | 489 DisplayList::iterator iter_to_update = to_update->begin(); |
| 484 DisplayList::const_iterator iter = displays_.begin(); | 490 DisplayList::const_iterator iter = displays_.begin(); |
| 485 for (; iter != displays_.end() && iter_to_update != to_update->end(); | 491 for (; iter != displays_.end() && iter_to_update != to_update->end(); |
| 486 ++iter, ++iter_to_update) { | 492 ++iter, ++iter_to_update) { |
| 487 (*iter_to_update).set_id((*iter).id()); | 493 (*iter_to_update).set_id((*iter).id()); |
| 488 } | 494 } |
| 489 } | 495 } |
| 490 | 496 |
| 491 } // namespace internal | 497 } // namespace internal |
| 492 } // namespace ash | 498 } // namespace ash |
| OLD | NEW |