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

Unified Diff: extensions/browser/api/system_display/display_info_provider.cc

Issue 689223002: Don't assume gfx::Screen::GetNumDisplays() == GetAllDisplays().size(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/system_display/display_info_provider.cc
diff --git a/extensions/browser/api/system_display/display_info_provider.cc b/extensions/browser/api/system_display/display_info_provider.cc
index da365082783f5c4da9cea931e239717931e06874..50a4c938629238b3e852ccf9d0a718a25b5e477d 100644
--- a/extensions/browser/api/system_display/display_info_provider.cc
+++ b/extensions/browser/api/system_display/display_info_provider.cc
@@ -80,10 +80,10 @@ DisplayInfo DisplayInfoProvider::GetAllDisplaysInfo() {
int64 primary_id = screen->GetPrimaryDisplay().id();
std::vector<gfx::Display> displays = screen->GetAllDisplays();
DisplayInfo all_displays;
- for (int i = 0; i < screen->GetNumDisplays(); ++i) {
+ for (const gfx::Display& display : displays) {
linked_ptr<core_api::system_display::DisplayUnitInfo> unit(
- CreateDisplayUnitInfo(displays[i], primary_id));
- UpdateDisplayUnitInfoForPlatform(displays[i], unit.get());
+ CreateDisplayUnitInfo(display, primary_id));
+ UpdateDisplayUnitInfoForPlatform(display, unit.get());
all_displays.push_back(unit);
}
return all_displays;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698