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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/display/display.h » ('j') | ui/display/display.h » ('J')
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 "chrome/browser/chromeos/display/display_preferences.h" 5 #include "chrome/browser/chromeos/display/display_preferences.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 void StoreCurrentDisplayLayoutPrefs() { 321 void StoreCurrentDisplayLayoutPrefs() {
322 display::DisplayManager* display_manager = GetDisplayManager(); 322 display::DisplayManager* display_manager = GetDisplayManager();
323 if (!UserCanSaveDisplayPreference() || 323 if (!UserCanSaveDisplayPreference() ||
324 display_manager->num_connected_displays() < 2) { 324 display_manager->num_connected_displays() < 2) {
325 return; 325 return;
326 } 326 }
327 327
328 display::DisplayIdList list = display_manager->GetCurrentDisplayIdList(); 328 display::DisplayIdList list = display_manager->GetCurrentDisplayIdList();
329 const display::DisplayLayout& display_layout = 329 const display::DisplayLayout& display_layout =
330 display_manager->layout_store()->GetRegisteredDisplayLayout(list); 330 display_manager->layout_store()->GetRegisteredDisplayLayout(list);
331
332 if (!display::DisplayLayout::Validate(list, display_layout)) {
333 // We should never apply an invalid layout, if we do, it persists and the
334 // user has no way of fixing it except by deleting the local state.
335 LOG(ERROR) << "Attempting to store an invalid display layout in the local"
336 << " state. Skipping.";
337 return;
338 }
339
331 StoreDisplayLayoutPref(list, display_layout); 340 StoreDisplayLayoutPref(list, display_layout);
332 } 341 }
333 342
334 void StoreCurrentDisplayProperties() { 343 void StoreCurrentDisplayProperties() {
335 display::DisplayManager* display_manager = GetDisplayManager(); 344 display::DisplayManager* display_manager = GetDisplayManager();
336 PrefService* local_state = g_browser_process->local_state(); 345 PrefService* local_state = g_browser_process->local_state();
337 346
338 DictionaryPrefUpdate update(local_state, prefs::kDisplayProperties); 347 DictionaryPrefUpdate update(local_state, prefs::kDisplayProperties);
339 base::DictionaryValue* pref_data = update.Get(); 348 base::DictionaryValue* pref_data = update.Get();
340 349
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 StoreDisplayPowerState(power_state); 500 StoreDisplayPowerState(power_state);
492 } 501 }
493 502
494 bool ParseTouchCalibrationStringForTest( 503 bool ParseTouchCalibrationStringForTest(
495 const std::string& str, 504 const std::string& str,
496 display::TouchCalibrationData::CalibrationPointPairQuad* point_pair_quad) { 505 display::TouchCalibrationData::CalibrationPointPairQuad* point_pair_quad) {
497 return ParseTouchCalibrationStringValue(str, point_pair_quad); 506 return ParseTouchCalibrationStringValue(str, point_pair_quad);
498 } 507 }
499 508
500 } // namespace chromeos 509 } // namespace chromeos
OLDNEW
« 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