Chromium Code Reviews| Index: ash/display/multi_display_manager.cc |
| diff --git a/ash/display/multi_display_manager.cc b/ash/display/multi_display_manager.cc |
| index aba85f02e5af38321ebd2485eeec50d0a70b6d03..9bda2d721808e61be3b5fa52c1181ebd3307d762 100644 |
| --- a/ash/display/multi_display_manager.cc |
| +++ b/ash/display/multi_display_manager.cc |
| @@ -148,6 +148,18 @@ const gfx::Display& MultiDisplayManager::FindDisplayContainingPoint( |
| void MultiDisplayManager::SetOverscanInsets(int64 display_id, |
| const gfx::Insets& insets_in_dip) { |
| + std::map<int64, gfx::Insets>::const_iterator old_overscan = |
| + overscan_mapping_.find(display_id); |
| + if (old_overscan != overscan_mapping_.end()) { |
| + gfx::Insets old_insets = old_overscan->second; |
| + gfx::Display& display = FindDisplayForId(display_id); |
| + if (display.id() != gfx::Display::kInvalidDisplayID) { |
|
oshima
2012/10/17 16:34:09
Can you add Display::is_valid() and use here?
Jun Mukai
2012/10/17 16:53:40
Done.
|
| + // Reimburse the existing insets before applying the new insets. |
| + gfx::Rect bounds = display.bounds_in_pixel(); |
| + bounds.Inset(old_insets.Scale(-display.device_scale_factor())); |
| + display.SetScaleAndBounds(display.device_scale_factor(), bounds); |
| + } |
| + } |
| overscan_mapping_[display_id] = insets_in_dip; |
| OnNativeDisplaysChanged(displays_); |
| } |
| @@ -446,7 +458,7 @@ gfx::Display& MultiDisplayManager::FindDisplayForId(int64 id) { |
| if ((*iter).id() == id) |
| return *iter; |
| } |
| - DLOG(FATAL) << "Could not find display:" << id; |
| + DLOG(WARNING) << "Could not find display:" << id; |
| return GetInvalidDisplay(); |
| } |