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

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

Issue 2070283002: Use container::back() and container::pop_back(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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
« no previous file with comments | « ash/accelerators/accelerator_controller.cc ('k') | ash/display/mirror_window_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 origins.insert(origin); 568 origins.insert(origin);
569 new_display_info_list.push_back(*iter); 569 new_display_info_list.push_back(*iter);
570 } 570 }
571 571
572 DisplayMode new_mode; 572 DisplayMode new_mode;
573 new_mode.size = iter->bounds_in_native().size(); 573 new_mode.size = iter->bounds_in_native().size();
574 new_mode.device_scale_factor = iter->device_scale_factor(); 574 new_mode.device_scale_factor = iter->device_scale_factor();
575 new_mode.ui_scale = iter->configured_ui_scale(); 575 new_mode.ui_scale = iter->configured_ui_scale();
576 const std::vector<DisplayMode>& display_modes = iter->display_modes(); 576 const std::vector<DisplayMode>& display_modes = iter->display_modes();
577 // This is empty the displays are initialized from InitFromCommandLine. 577 // This is empty the displays are initialized from InitFromCommandLine.
578 if (!display_modes.size()) 578 if (display_modes.empty())
579 continue; 579 continue;
580 auto display_modes_iter = FindDisplayMode(*iter, new_mode); 580 auto display_modes_iter = FindDisplayMode(*iter, new_mode);
581 // Update the actual resolution selected as the resolution request may fail. 581 // Update the actual resolution selected as the resolution request may fail.
582 if (display_modes_iter == display_modes.end()) 582 if (display_modes_iter == display_modes.end())
583 display_modes_.erase(iter->id()); 583 display_modes_.erase(iter->id());
584 else if (display_modes_.find(iter->id()) != display_modes_.end()) 584 else if (display_modes_.find(iter->id()) != display_modes_.end())
585 display_modes_[iter->id()] = *display_modes_iter; 585 display_modes_[iter->id()] = *display_modes_iter;
586 } 586 }
587 if (display::Display::HasInternalDisplay() && !internal_display_connected) { 587 if (display::Display::HasInternalDisplay() && !internal_display_connected) {
588 if (display_info_.find(display::Display::InternalDisplayId()) == 588 if (display_info_.find(display::Display::InternalDisplayId()) ==
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 layout.ApplyToDisplayList(display_list, updated_ids, 1334 layout.ApplyToDisplayList(display_list, updated_ids,
1335 kMinimumOverlapForInvalidOffset); 1335 kMinimumOverlapForInvalidOffset);
1336 } 1336 }
1337 1337
1338 void DisplayManager::RunPendingTasksForTest() { 1338 void DisplayManager::RunPendingTasksForTest() {
1339 if (!software_mirroring_display_list_.empty()) 1339 if (!software_mirroring_display_list_.empty())
1340 base::RunLoop().RunUntilIdle(); 1340 base::RunLoop().RunUntilIdle();
1341 } 1341 }
1342 1342
1343 } // namespace ash 1343 } // namespace ash
OLDNEW
« no previous file with comments | « ash/accelerators/accelerator_controller.cc ('k') | ash/display/mirror_window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698