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

Side by Side Diff: chrome/browser/chromeos/display/display_preferences.cc

Issue 289583002: Lock rotation when screen is manually rotated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Block saving directly Created 6 years, 7 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 (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" 10 #include "ash/display/resolution_notification_controller.h"
11 #include "ash/shell.h" 11 #include "ash/shell.h"
12 #include "ash/wm/maximize_mode/maximize_mode_controller.h"
12 #include "base/prefs/pref_registry_simple.h" 13 #include "base/prefs/pref_registry_simple.h"
13 #include "base/prefs/pref_service.h" 14 #include "base/prefs/pref_service.h"
14 #include "base/prefs/scoped_user_pref_update.h" 15 #include "base/prefs/scoped_user_pref_update.h"
15 #include "base/strings/string16.h" 16 #include "base/strings/string16.h"
16 #include "base/strings/string_number_conversions.h" 17 #include "base/strings/string_number_conversions.h"
17 #include "base/strings/string_split.h" 18 #include "base/strings/string_split.h"
18 #include "base/strings/string_util.h" 19 #include "base/strings/string_util.h"
19 #include "base/values.h" 20 #include "base/values.h"
20 #include "chrome/browser/browser_process.h" 21 #include "chrome/browser/browser_process.h"
21 #include "chrome/browser/chromeos/login/user_manager.h" 22 #include "chrome/browser/chromeos/login/user_manager.h"
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 // state respects to the current status (close/open) of the lid which can be 303 // state respects to the current status (close/open) of the lid which can be
303 // changed in any situation. See crbug.com/285360 304 // changed in any situation. See crbug.com/285360
304 StoreCurrentDisplayPowerState(); 305 StoreCurrentDisplayPowerState();
305 306
306 // Do not store prefs when the confirmation dialog is shown. 307 // Do not store prefs when the confirmation dialog is shown.
307 if (!UserCanSaveDisplayPreference() || 308 if (!UserCanSaveDisplayPreference() ||
308 ash::Shell::GetInstance()->resolution_notification_controller()-> 309 ash::Shell::GetInstance()->resolution_notification_controller()->
309 DoesNotificationTimeout()) { 310 DoesNotificationTimeout()) {
310 return; 311 return;
311 } 312 }
313
314 ash::Shell* shell = ash::Shell::GetInstance();
315 if (shell->IsMaximizeModeWindowManagerEnabled() &&
316 shell->maximize_mode_controller()->accelerometer_setting_rotation()) {
317 return;
318 }
oshima 2014/05/22 17:14:29 Can you define a predicate like Shell::ShoudDispl
jonross 2014/05/23 19:07:20 Done.
319
312 StoreCurrentDisplayLayoutPrefs(); 320 StoreCurrentDisplayLayoutPrefs();
313 StoreCurrentDisplayProperties(); 321 StoreCurrentDisplayProperties();
314 } 322 }
315 323
316 void SetCurrentDisplayLayout(const ash::DisplayLayout& layout) { 324 void SetCurrentDisplayLayout(const ash::DisplayLayout& layout) {
317 GetDisplayManager()->SetLayoutForCurrentDisplays(layout); 325 GetDisplayManager()->SetLayoutForCurrentDisplays(layout);
318 } 326 }
319 327
320 void LoadDisplayPreferences(bool first_run_after_boot) { 328 void LoadDisplayPreferences(bool first_run_after_boot) {
321 LoadDisplayLayouts(); 329 LoadDisplayLayouts();
(...skipping 16 matching lines...) Expand all
338 const ash::DisplayLayout& layout) { 346 const ash::DisplayLayout& layout) {
339 StoreDisplayLayoutPref(std::make_pair(id1, id2), layout); 347 StoreDisplayLayoutPref(std::make_pair(id1, id2), layout);
340 } 348 }
341 349
342 // Stores the given |power_state|. 350 // Stores the given |power_state|.
343 void StoreDisplayPowerStateForTest(DisplayPowerState power_state) { 351 void StoreDisplayPowerStateForTest(DisplayPowerState power_state) {
344 StoreDisplayPowerState(power_state); 352 StoreDisplayPowerState(power_state);
345 } 353 }
346 354
347 } // namespace chromeos 355 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698