Chromium Code Reviews| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 282 FindDisplayIndexContainingPoint(active_display_list_, point_in_screen); | 282 FindDisplayIndexContainingPoint(active_display_list_, point_in_screen); |
| 283 return index < 0 ? GetInvalidDisplay() : active_display_list_[index]; | 283 return index < 0 ? GetInvalidDisplay() : active_display_list_[index]; |
| 284 } | 284 } |
| 285 | 285 |
| 286 bool DisplayManager::UpdateWorkAreaOfDisplay(int64_t display_id, | 286 bool DisplayManager::UpdateWorkAreaOfDisplay(int64_t display_id, |
| 287 const gfx::Insets& insets) { | 287 const gfx::Insets& insets) { |
| 288 display::Display* display = FindDisplayForId(display_id); | 288 display::Display* display = FindDisplayForId(display_id); |
| 289 DCHECK(display); | 289 DCHECK(display); |
| 290 gfx::Rect old_work_area = display->work_area(); | 290 gfx::Rect old_work_area = display->work_area(); |
| 291 display->UpdateWorkAreaFromInsets(insets); | 291 display->UpdateWorkAreaFromInsets(insets); |
| 292 if (old_work_area != display->work_area()) { | |
|
oshima
2016/07/26 20:53:03
nit:
bool workarea_changed = old_work_area != dis
hariank
2016/07/26 22:05:16
Done.
| |
| 293 screen_->NotifyMetricsChanged( | |
| 294 *display, display::DisplayObserver::DISPLAY_METRIC_WORK_AREA); | |
| 295 } | |
| 292 return old_work_area != display->work_area(); | 296 return old_work_area != display->work_area(); |
| 293 } | 297 } |
| 294 | 298 |
| 295 void DisplayManager::SetOverscanInsets(int64_t display_id, | 299 void DisplayManager::SetOverscanInsets(int64_t display_id, |
| 296 const gfx::Insets& insets_in_dip) { | 300 const gfx::Insets& insets_in_dip) { |
| 297 bool update = false; | 301 bool update = false; |
| 298 DisplayInfoList display_info_list; | 302 DisplayInfoList display_info_list; |
| 299 for (const auto& display : active_display_list_) { | 303 for (const auto& display : active_display_list_) { |
| 300 DisplayInfo info = GetDisplayInfo(display.id()); | 304 DisplayInfo info = GetDisplayInfo(display.id()); |
| 301 if (info.id() == display_id) { | 305 if (info.id() == display_id) { |
| (...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1334 layout.ApplyToDisplayList(display_list, updated_ids, | 1338 layout.ApplyToDisplayList(display_list, updated_ids, |
| 1335 kMinimumOverlapForInvalidOffset); | 1339 kMinimumOverlapForInvalidOffset); |
| 1336 } | 1340 } |
| 1337 | 1341 |
| 1338 void DisplayManager::RunPendingTasksForTest() { | 1342 void DisplayManager::RunPendingTasksForTest() { |
| 1339 if (!software_mirroring_display_list_.empty()) | 1343 if (!software_mirroring_display_list_.empty()) |
| 1340 base::RunLoop().RunUntilIdle(); | 1344 base::RunLoop().RunUntilIdle(); |
| 1341 } | 1345 } |
| 1342 | 1346 |
| 1343 } // namespace ash | 1347 } // namespace ash |
| OLD | NEW |