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

Side by Side Diff: chrome/browser/chromeos/login/screens/user_selection_screen.cc

Issue 375413002: Replace chromeos::UserManager::Get() with chromeos::GetUserManager(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/login/screens/user_selection_screen.h" 5 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 user_dict->SetString(kKeyDisplayName, user->GetDisplayName()); 70 user_dict->SetString(kKeyDisplayName, user->GetDisplayName());
71 user_dict->SetBoolean(kKeyPublicAccount, is_public_account); 71 user_dict->SetBoolean(kKeyPublicAccount, is_public_account);
72 user_dict->SetBoolean(kKeyLocallyManagedUser, is_locally_managed_user); 72 user_dict->SetBoolean(kKeyLocallyManagedUser, is_locally_managed_user);
73 user_dict->SetInteger(kKeyInitialAuthType, auth_type); 73 user_dict->SetInteger(kKeyInitialAuthType, auth_type);
74 user_dict->SetBoolean(kKeySignedIn, user->is_logged_in()); 74 user_dict->SetBoolean(kKeySignedIn, user->is_logged_in());
75 user_dict->SetBoolean(kKeyIsOwner, is_owner); 75 user_dict->SetBoolean(kKeyIsOwner, is_owner);
76 76
77 // Fill in multi-profiles related fields. 77 // Fill in multi-profiles related fields.
78 if (is_signin_to_add) { 78 if (is_signin_to_add) {
79 MultiProfileUserController* multi_profile_user_controller = 79 MultiProfileUserController* multi_profile_user_controller =
80 UserManager::Get()->GetMultiProfileUserController(); 80 GetUserManager()->GetMultiProfileUserController();
81 std::string behavior = 81 std::string behavior =
82 multi_profile_user_controller->GetCachedValue(user_id); 82 multi_profile_user_controller->GetCachedValue(user_id);
83 user_dict->SetBoolean(kKeyMultiProfilesAllowed, 83 user_dict->SetBoolean(kKeyMultiProfilesAllowed,
84 multi_profile_user_controller->IsUserAllowedInSession( 84 multi_profile_user_controller->IsUserAllowedInSession(
85 user_id) == MultiProfileUserController::ALLOWED); 85 user_id) == MultiProfileUserController::ALLOWED);
86 user_dict->SetString(kKeyMultiProfilesPolicy, behavior); 86 user_dict->SetString(kKeyMultiProfilesPolicy, behavior);
87 } else { 87 } else {
88 user_dict->SetBoolean(kKeyMultiProfilesAllowed, true); 88 user_dict->SetBoolean(kKeyMultiProfilesAllowed, true);
89 } 89 }
90 90
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 } 224 }
225 225
226 void UserSelectionScreen::SendUserList(bool animated) { 226 void UserSelectionScreen::SendUserList(bool animated) {
227 base::ListValue users_list; 227 base::ListValue users_list;
228 const UserList& users = GetUsers(); 228 const UserList& users = GetUsers();
229 229
230 // TODO(nkostylev): Move to a separate method in UserManager. 230 // TODO(nkostylev): Move to a separate method in UserManager.
231 // http://crbug.com/230852 231 // http://crbug.com/230852
232 bool single_user = users.size() == 1; 232 bool single_user = users.size() == 1;
233 bool is_signin_to_add = LoginDisplayHostImpl::default_host() && 233 bool is_signin_to_add = LoginDisplayHostImpl::default_host() &&
234 UserManager::Get()->IsUserLoggedIn(); 234 GetUserManager()->IsUserLoggedIn();
235 std::string owner; 235 std::string owner;
236 chromeos::CrosSettings::Get()->GetString(chromeos::kDeviceOwner, &owner); 236 chromeos::CrosSettings::Get()->GetString(chromeos::kDeviceOwner, &owner);
237 237
238 policy::BrowserPolicyConnectorChromeOS* connector = 238 policy::BrowserPolicyConnectorChromeOS* connector =
239 g_browser_process->platform_part()->browser_policy_connector_chromeos(); 239 g_browser_process->platform_part()->browser_policy_connector_chromeos();
240 bool is_enterprise_managed = connector->IsEnterpriseManaged(); 240 bool is_enterprise_managed = connector->IsEnterpriseManaged();
241 241
242 const UserList users_to_send = PrepareUserListForSending(users, 242 const UserList users_to_send = PrepareUserListForSending(users,
243 owner, 243 owner,
244 is_signin_to_add); 244 is_signin_to_add);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 } 286 }
287 287
288 ScreenlockBridge::LockHandler::AuthType UserSelectionScreen::GetAuthType( 288 ScreenlockBridge::LockHandler::AuthType UserSelectionScreen::GetAuthType(
289 const std::string& username) const { 289 const std::string& username) const {
290 if (user_auth_type_map_.find(username) == user_auth_type_map_.end()) 290 if (user_auth_type_map_.find(username) == user_auth_type_map_.end())
291 return ScreenlockBridge::LockHandler::OFFLINE_PASSWORD; 291 return ScreenlockBridge::LockHandler::OFFLINE_PASSWORD;
292 return user_auth_type_map_.find(username)->second; 292 return user_auth_type_map_.find(username)->second;
293 } 293 }
294 294
295 } // namespace chromeos 295 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698