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

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

Issue 2946463002: Convert multi-profile user behavior string to enum and send it to UI. (Closed)
Patch Set: Created 3 years, 6 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 | chrome/browser/chromeos/login/users/multi_profile_user_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 user_dict->SetBoolean(kKeyMultiProfilesAllowed, isUserAllowed); 330 user_dict->SetBoolean(kKeyMultiProfilesAllowed, isUserAllowed);
331 331
332 std::string behavior; 332 std::string behavior;
333 switch (isUserAllowedReason) { 333 switch (isUserAllowedReason) {
334 case MultiProfileUserController::NOT_ALLOWED_OWNER_AS_SECONDARY: 334 case MultiProfileUserController::NOT_ALLOWED_OWNER_AS_SECONDARY:
335 behavior = MultiProfileUserController::kBehaviorOwnerPrimaryOnly; 335 behavior = MultiProfileUserController::kBehaviorOwnerPrimaryOnly;
336 break; 336 break;
337 default: 337 default:
338 behavior = multi_profile_user_controller->GetCachedValue(user_id); 338 behavior = multi_profile_user_controller->GetCachedValue(user_id);
339 } 339 }
340 user_dict->SetString(kKeyMultiProfilesPolicy, behavior); 340 MultiProfileUserController::MultiProfileUserBehavior user_behavior =
341 MultiProfileUserController::UserBehaviorStringToEnum(behavior);
342 user_dict->SetInteger(kKeyMultiProfilesPolicy,
343 static_cast<int>(user_behavior));
341 } else { 344 } else {
342 user_dict->SetBoolean(kKeyMultiProfilesAllowed, true); 345 user_dict->SetBoolean(kKeyMultiProfilesAllowed, true);
343 } 346 }
344 } 347 }
345 348
346 // static 349 // static
347 bool UserSelectionScreen::ShouldForceOnlineSignIn( 350 bool UserSelectionScreen::ShouldForceOnlineSignIn(
348 const user_manager::User* user) { 351 const user_manager::User* user) {
349 // Public sessions are always allowed to log in offline. 352 // Public sessions are always allowed to log in offline.
350 // Supervised users are always allowed to log in offline. 353 // Supervised users are always allowed to log in offline.
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 // The user profile should exist if and only if this is the lock screen. 709 // The user profile should exist if and only if this is the lock screen.
707 DCHECK_EQ(!!profile, GetScreenType() == LOCK_SCREEN); 710 DCHECK_EQ(!!profile, GetScreenType() == LOCK_SCREEN);
708 711
709 if (!profile) 712 if (!profile)
710 profile = profile_helper->GetSigninProfile(); 713 profile = profile_helper->GetSigninProfile();
711 714
712 return EasyUnlockService::Get(profile); 715 return EasyUnlockService::Get(profile);
713 } 716 }
714 717
715 } // namespace chromeos 718 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/users/multi_profile_user_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698