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

Side by Side Diff: chrome/browser/supervised_user/child_accounts/child_account_service.cc

Issue 785893003: Adapt Chrome OS related part of ChildAccountService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ClearUserList method updated for mock. Created 6 years 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/supervised_user/child_accounts/child_account_service.h" 5 #include "chrome/browser/supervised_user/child_accounts/child_account_service.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 profile_->GetPrefs()->SetString(prefs::kSupervisedUserId, 287 profile_->GetPrefs()->SetString(prefs::kSupervisedUserId,
288 kChildAccountSUID); 288 kChildAccountSUID);
289 } else { 289 } else {
290 profile_->GetPrefs()->ClearPref(prefs::kSupervisedUserId); 290 profile_->GetPrefs()->ClearPref(prefs::kSupervisedUserId);
291 } 291 }
292 PropagateChildStatusToUser(is_child_account); 292 PropagateChildStatusToUser(is_child_account);
293 } 293 }
294 294
295 void ChildAccountService::PropagateChildStatusToUser(bool is_child) { 295 void ChildAccountService::PropagateChildStatusToUser(bool is_child) {
296 #if defined(OS_CHROMEOS) 296 #if defined(OS_CHROMEOS)
297 // TODO(merkulova,treib): Figure out why this causes tests to fail. 297 user_manager::User* user =
298 // user_manager::User* user = 298 chromeos::ProfileHelper::Get()->GetUserByProfile(profile_);
299 // chromeos::ProfileHelper::Get()->GetUserByProfile(profile_); 299 if (!user) {
300 // if (user) { 300 LOG(WARNING) <<
301 // user_manager::UserManager::Get()->ChangeUserSupervisedStatus( 301 "User instance wasn't found while setting child account flag.";
302 // user, is_child); 302 } else if (user->GetType() == user_manager::USER_TYPE_REGULAR_SUPERVISED ||
Marc Treib 2014/12/08 16:59:34 Hm, I don't think we should check the user type he
Marc Treib 2014/12/10 12:42:36 This one's still not addressed.
303 // } else { 303 user->GetType() == user_manager::USER_TYPE_REGULAR) {
304 // LOG(WARNING) << 304 user_manager::UserManager::Get()->ChangeUserSupervisedStatus(
305 // "User instance wasn't found while setting child account flag."; 305 user, is_child);
306 // } 306 }
307 #endif 307 #endif
308 } 308 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698