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

Side by Side Diff: ui/display/manager/display_manager_utilities.cc

Issue 2814843007: Fix expected PlacementList sort order. (Closed)
Patch Set: Don't register invalid layouts Created 3 years, 8 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ui/display/manager/display_manager_utilities.h" 5 #include "ui/display/manager/display_manager_utilities.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/sys_info.h" 10 #include "base/sys_info.h"
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 std::string DisplayIdListToString(const DisplayIdList& list) { 280 std::string DisplayIdListToString(const DisplayIdList& list) {
281 std::stringstream s; 281 std::stringstream s;
282 const char* sep = ""; 282 const char* sep = "";
283 for (int64_t id : list) { 283 for (int64_t id : list) {
284 s << sep << id; 284 s << sep << id;
285 sep = ","; 285 sep = ",";
286 } 286 }
287 return s.str(); 287 return s.str();
288 } 288 }
289 289
290 bool CompareDisplayIds(int64_t id1, int64_t id2) {
291 DCHECK_NE(id1, id2);
292 // Output index is stored in the first 8 bits. See GetDisplayIdFromEDID
293 // in edid_parser.cc.
294 int index_1 = id1 & 0xFF;
295 int index_2 = id2 & 0xFF;
296 DCHECK_NE(index_1, index_2) << id1 << " and " << id2;
297 return Display::IsInternalDisplayId(id1) ||
298 (index_1 < index_2 && !Display::IsInternalDisplayId(id2));
299 }
300
301 } // namespace display 290 } // namespace display
OLDNEW
« ui/display/display.cc ('K') | « ui/display/manager/display_manager_utilities.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698