OLD | NEW |
---|---|
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/chrome_user_manager.h" | 5 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
6 #include "components/user_manager/user_manager.h" | 6 #include "components/user_manager/user_manager.h" |
7 | 7 |
8 namespace chromeos { | 8 namespace chromeos { |
9 | 9 |
10 ChromeUserManager::ChromeUserManager( | 10 ChromeUserManager::ChromeUserManager( |
11 scoped_refptr<base::TaskRunner> task_runner, | 11 scoped_refptr<base::TaskRunner> task_runner, |
12 scoped_refptr<base::TaskRunner> blocking_task_runner) | 12 scoped_refptr<base::TaskRunner> blocking_task_runner) |
13 : UserManagerBase(task_runner, blocking_task_runner) { | 13 : UserManagerBase(task_runner, blocking_task_runner) { |
14 } | 14 } |
15 | 15 |
16 ChromeUserManager::~ChromeUserManager() { | 16 ChromeUserManager::~ChromeUserManager() { |
17 } | 17 } |
18 | 18 |
19 // static | 19 // static |
20 ChromeUserManager* ChromeUserManager::Get() { | 20 ChromeUserManager* ChromeUserManager::Get() { |
21 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); | 21 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); |
22 return user_manager ? static_cast<ChromeUserManager*>(user_manager) : NULL; | 22 return user_manager ? static_cast<ChromeUserManager*>(user_manager) : NULL; |
23 } | 23 } |
24 | 24 |
25 // static | |
26 user_manager::UserList ChromeUserManager::GetUsersAllowedAsSUManagers( | |
27 const user_manager::UserList& user_list) { | |
28 user_manager::UserList result; | |
29 for (user_manager::User* user : user_list) { | |
30 if (user->GetType() == user_manager::USER_TYPE_REGULAR) { | |
Nikita (slow)
2014/11/12 11:09:08
nit: merge with https://codereview.chromium.org/71
merkulova
2014/11/12 13:19:51
Why not simply leave this check?
Nikita (slow)
2014/11/12 13:43:37
I think that this condition (user->IsRegular() &&
| |
31 result.push_back(user); | |
32 } | |
33 } | |
34 return result; | |
35 } | |
36 | |
25 } // namespace chromeos | 37 } // namespace chromeos |
OLD | NEW |