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

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

Issue 718673002: New user type introduced. Combines regular and supervised features. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Logical expression fixed. Created 6 years, 1 month 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/shell.h" 10 #include "ash/shell.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 ash::DisplayManager* GetDisplayManager() { 94 ash::DisplayManager* GetDisplayManager() {
95 return ash::Shell::GetInstance()->display_manager(); 95 return ash::Shell::GetInstance()->display_manager();
96 } 96 }
97 97
98 // Returns true id the current user can write display preferences to 98 // Returns true id the current user can write display preferences to
99 // Local State. 99 // Local State.
100 bool UserCanSaveDisplayPreference() { 100 bool UserCanSaveDisplayPreference() {
101 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); 101 user_manager::UserManager* user_manager = user_manager::UserManager::Get();
102 return user_manager->IsUserLoggedIn() && 102 return user_manager->IsUserLoggedIn() &&
103 (user_manager->IsLoggedInAsRegularUser() || 103 (user_manager->IsLoggedInAsUserWithGaiaAccount() ||
104 user_manager->IsLoggedInAsSupervisedUser() || 104 user_manager->IsLoggedInAsSupervisedUser() ||
105 user_manager->IsLoggedInAsKioskApp()); 105 user_manager->IsLoggedInAsKioskApp());
106 } 106 }
107 107
108 void LoadDisplayLayouts() { 108 void LoadDisplayLayouts() {
109 PrefService* local_state = g_browser_process->local_state(); 109 PrefService* local_state = g_browser_process->local_state();
110 ash::DisplayLayoutStore* layout_store = GetDisplayManager()->layout_store(); 110 ash::DisplayLayoutStore* layout_store = GetDisplayManager()->layout_store();
111 111
112 const base::DictionaryValue* layouts = local_state->GetDictionary( 112 const base::DictionaryValue* layouts = local_state->GetDictionary(
113 prefs::kSecondaryDisplays); 113 prefs::kSecondaryDisplays);
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 const ash::DisplayLayout& layout) { 387 const ash::DisplayLayout& layout) {
388 StoreDisplayLayoutPref(std::make_pair(id1, id2), layout); 388 StoreDisplayLayoutPref(std::make_pair(id1, id2), layout);
389 } 389 }
390 390
391 // Stores the given |power_state|. 391 // Stores the given |power_state|.
392 void StoreDisplayPowerStateForTest(DisplayPowerState power_state) { 392 void StoreDisplayPowerStateForTest(DisplayPowerState power_state) {
393 StoreDisplayPowerState(power_state); 393 StoreDisplayPowerState(power_state);
394 } 394 }
395 395
396 } // namespace chromeos 396 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698