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

Side by Side Diff: chrome/browser/chromeos/login/users/multi_profile_user_controller.cc

Issue 2937553002: Create Mojo Struct for user information used in login/lock screen. (Closed)
Patch Set: rebase 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
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/users/multi_profile_user_controller.h" 5 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 // No user is allowed if the primary user policy forbids it. 121 // No user is allowed if the primary user policy forbids it.
122 const std::string behavior = profile->GetPrefs()->GetString( 122 const std::string behavior = profile->GetPrefs()->GetString(
123 prefs::kMultiProfileUserBehavior); 123 prefs::kMultiProfileUserBehavior);
124 if (behavior == kBehaviorNotAllowed) 124 if (behavior == kBehaviorNotAllowed)
125 return NOT_ALLOWED_PRIMARY_USER_POLICY_FORBIDS; 125 return NOT_ALLOWED_PRIMARY_USER_POLICY_FORBIDS;
126 126
127 return ALLOWED; 127 return ALLOWED;
128 } 128 }
129 129
130 // static 130 // static
131 MultiProfileUserController::MultiProfileUserBehavior 131 ash::mojom::MultiProfileUserBehavior
132 MultiProfileUserController::UserBehaviorStringToEnum( 132 MultiProfileUserController::UserBehaviorStringToEnum(
133 const std::string& behavior) { 133 const std::string& behavior) {
134 if (behavior == kBehaviorPrimaryOnly) 134 if (behavior == kBehaviorPrimaryOnly)
135 return MultiProfileUserBehavior::kPrimaryOnly; 135 return ash::mojom::MultiProfileUserBehavior::PRIMARY_ONLY;
136 if (behavior == kBehaviorNotAllowed) 136 if (behavior == kBehaviorNotAllowed)
137 return MultiProfileUserBehavior::kNotAllowed; 137 return ash::mojom::MultiProfileUserBehavior::NOT_ALLOWED;
138 if (behavior == kBehaviorOwnerPrimaryOnly) 138 if (behavior == kBehaviorOwnerPrimaryOnly)
139 return MultiProfileUserBehavior::kOwnerPrimaryOnly; 139 return ash::mojom::MultiProfileUserBehavior::OWNER_PRIMARY_ONLY;
140 140
141 return MultiProfileUserBehavior::kUnrestriced; 141 return ash::mojom::MultiProfileUserBehavior::UNRESTRICTED;
142 } 142 }
143 143
144 bool MultiProfileUserController::IsUserAllowedInSession( 144 bool MultiProfileUserController::IsUserAllowedInSession(
145 const std::string& user_email, 145 const std::string& user_email,
146 MultiProfileUserController::UserAllowedInSessionReason* reason) const { 146 MultiProfileUserController::UserAllowedInSessionReason* reason) const {
147 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); 147 user_manager::UserManager* user_manager = user_manager::UserManager::Get();
148 CHECK(user_manager); 148 CHECK(user_manager);
149 149
150 const user_manager::User* primary_user = user_manager->GetPrimaryUser(); 150 const user_manager::User* primary_user = user_manager->GetPrimaryUser();
151 std::string primary_user_email; 151 std::string primary_user_email;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 } else { 248 } else {
249 const std::string behavior = 249 const std::string behavior =
250 prefs->GetString(prefs::kMultiProfileUserBehavior); 250 prefs->GetString(prefs::kMultiProfileUserBehavior);
251 SetCachedValue(user_email, behavior); 251 SetCachedValue(user_email, behavior);
252 } 252 }
253 253
254 CheckSessionUsers(); 254 CheckSessionUsers();
255 } 255 }
256 256
257 } // namespace chromeos 257 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698