OLD | NEW |
---|---|
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 "ash/display/display_layout_store.h" | 7 #include "ash/display/display_layout_store.h" |
8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
9 #include "ash/display/display_pref_util.h" | 9 #include "ash/display/display_pref_util.h" |
10 #include "ash/display/resolution_notification_controller.h" | |
11 #include "ash/shell.h" | 10 #include "ash/shell.h" |
11 #include "ash/wm/maximize_mode/maximize_mode_controller.h" | |
oshima
2014/05/23 20:00:57
nit: you don't need this?
jonross
2014/05/26 19:05:48
Done.
| |
12 #include "base/prefs/pref_registry_simple.h" | 12 #include "base/prefs/pref_registry_simple.h" |
13 #include "base/prefs/pref_service.h" | 13 #include "base/prefs/pref_service.h" |
14 #include "base/prefs/scoped_user_pref_update.h" | 14 #include "base/prefs/scoped_user_pref_update.h" |
15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
17 #include "base/strings/string_split.h" | 17 #include "base/strings/string_split.h" |
18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
19 #include "base/values.h" | 19 #include "base/values.h" |
20 #include "chrome/browser/browser_process.h" | 20 #include "chrome/browser/browser_process.h" |
21 #include "chrome/browser/chromeos/login/users/user_manager.h" | 21 #include "chrome/browser/chromeos/login/users/user_manager.h" |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
298 } | 298 } |
299 | 299 |
300 void StoreDisplayPrefs() { | 300 void StoreDisplayPrefs() { |
301 // Stores the power state regardless of the login status, because the power | 301 // Stores the power state regardless of the login status, because the power |
302 // state respects to the current status (close/open) of the lid which can be | 302 // state respects to the current status (close/open) of the lid which can be |
303 // changed in any situation. See crbug.com/285360 | 303 // changed in any situation. See crbug.com/285360 |
304 StoreCurrentDisplayPowerState(); | 304 StoreCurrentDisplayPowerState(); |
305 | 305 |
306 // Do not store prefs when the confirmation dialog is shown. | 306 // Do not store prefs when the confirmation dialog is shown. |
307 if (!UserCanSaveDisplayPreference() || | 307 if (!UserCanSaveDisplayPreference() || |
308 ash::Shell::GetInstance()->resolution_notification_controller()-> | 308 !ash::Shell::GetInstance()->ShouldSaveDisplaySettings()) |
flackr
2014/05/26 16:05:18
nit: curlies necessary { }.
jonross
2014/05/26 19:05:48
Done.
| |
309 DoesNotificationTimeout()) { | |
310 return; | 309 return; |
311 } | 310 |
312 StoreCurrentDisplayLayoutPrefs(); | 311 StoreCurrentDisplayLayoutPrefs(); |
313 StoreCurrentDisplayProperties(); | 312 StoreCurrentDisplayProperties(); |
314 } | 313 } |
315 | 314 |
316 void SetCurrentDisplayLayout(const ash::DisplayLayout& layout) { | 315 void SetCurrentDisplayLayout(const ash::DisplayLayout& layout) { |
317 GetDisplayManager()->SetLayoutForCurrentDisplays(layout); | 316 GetDisplayManager()->SetLayoutForCurrentDisplays(layout); |
318 } | 317 } |
319 | 318 |
320 void LoadDisplayPreferences(bool first_run_after_boot) { | 319 void LoadDisplayPreferences(bool first_run_after_boot) { |
321 LoadDisplayLayouts(); | 320 LoadDisplayLayouts(); |
(...skipping 16 matching lines...) Expand all Loading... | |
338 const ash::DisplayLayout& layout) { | 337 const ash::DisplayLayout& layout) { |
339 StoreDisplayLayoutPref(std::make_pair(id1, id2), layout); | 338 StoreDisplayLayoutPref(std::make_pair(id1, id2), layout); |
340 } | 339 } |
341 | 340 |
342 // Stores the given |power_state|. | 341 // Stores the given |power_state|. |
343 void StoreDisplayPowerStateForTest(DisplayPowerState power_state) { | 342 void StoreDisplayPowerStateForTest(DisplayPowerState power_state) { |
344 StoreDisplayPowerState(power_state); | 343 StoreDisplayPowerState(power_state); |
345 } | 344 } |
346 | 345 |
347 } // namespace chromeos | 346 } // namespace chromeos |
OLD | NEW |