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

Unified Diff: chrome/browser/chromeos/display/display_preferences.cc

Issue 2814843007: Fix expected PlacementList sort order. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/display/display.h » ('j') | ui/display/display.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/display/display_preferences.cc
diff --git a/chrome/browser/chromeos/display/display_preferences.cc b/chrome/browser/chromeos/display/display_preferences.cc
index c6175250be6380c485d7671d25c612f86863555b..4beac908b985c2208c833d42d8c60d080f6c6f1c 100644
--- a/chrome/browser/chromeos/display/display_preferences.cc
+++ b/chrome/browser/chromeos/display/display_preferences.cc
@@ -328,6 +328,15 @@ void StoreCurrentDisplayLayoutPrefs() {
display::DisplayIdList list = display_manager->GetCurrentDisplayIdList();
const display::DisplayLayout& display_layout =
display_manager->layout_store()->GetRegisteredDisplayLayout(list);
+
+ if (!display::DisplayLayout::Validate(list, display_layout)) {
+ // We should never apply an invalid layout, if we do, it persists and the
+ // user has no way of fixing it except by deleting the local state.
+ LOG(ERROR) << "Attempting to store an invalid display layout in the local"
+ << " state. Skipping.";
+ return;
+ }
+
StoreDisplayLayoutPref(list, display_layout);
}
« no previous file with comments | « no previous file | ui/display/display.h » ('j') | ui/display/display.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698