Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: ash/display/display_manager.cc

Issue 2335963002: Refactor: remove SetDisplayWorkAreaInsets calls. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 return old_work_area != display->work_area(); 292 bool workarea_changed = old_work_area != display->work_area();
293 if (workarea_changed) {
294 screen_->NotifyMetricsChanged(
295 *display, display::DisplayObserver::DISPLAY_METRIC_WORK_AREA);
296 }
297 return workarea_changed;
293 } 298 }
294 299
295 void DisplayManager::SetOverscanInsets(int64_t display_id, 300 void DisplayManager::SetOverscanInsets(int64_t display_id,
296 const gfx::Insets& insets_in_dip) { 301 const gfx::Insets& insets_in_dip) {
297 bool update = false; 302 bool update = false;
298 DisplayInfoList display_info_list; 303 DisplayInfoList display_info_list;
299 for (const auto& display : active_display_list_) { 304 for (const auto& display : active_display_list_) {
300 DisplayInfo info = GetDisplayInfo(display.id()); 305 DisplayInfo info = GetDisplayInfo(display.id());
301 if (info.id() == display_id) { 306 if (info.id() == display_id) {
302 if (insets_in_dip.IsEmpty()) { 307 if (insets_in_dip.IsEmpty()) {
(...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 layout.ApplyToDisplayList(display_list, updated_ids, 1339 layout.ApplyToDisplayList(display_list, updated_ids,
1335 kMinimumOverlapForInvalidOffset); 1340 kMinimumOverlapForInvalidOffset);
1336 } 1341 }
1337 1342
1338 void DisplayManager::RunPendingTasksForTest() { 1343 void DisplayManager::RunPendingTasksForTest() {
1339 if (!software_mirroring_display_list_.empty()) 1344 if (!software_mirroring_display_list_.empty())
1340 base::RunLoop().RunUntilIdle(); 1345 base::RunLoop().RunUntilIdle();
1341 } 1346 }
1342 1347
1343 } // namespace ash 1348 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/web_notification/ash_popup_alignment_delegate.cc ('k') | ash/display/display_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698