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/mock_user_manager.h" | 5 #include "chrome/browser/chromeos/login/users/mock_user_manager.h" |
6 | 6 |
7 #include "chrome/browser/chromeos/login/users/fake_supervised_user_manager.h" | 7 #include "chrome/browser/chromeos/login/users/fake_supervised_user_manager.h" |
8 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 8 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
9 | 9 |
10 namespace chromeos { | 10 namespace chromeos { |
(...skipping 10 matching lines...) Expand all Loading... | |
21 } | 21 } |
22 | 22 |
23 const user_manager::UserList& MockUserManager::GetUsers() const { | 23 const user_manager::UserList& MockUserManager::GetUsers() const { |
24 return user_list_; | 24 return user_list_; |
25 } | 25 } |
26 | 26 |
27 const user_manager::User* MockUserManager::GetLoggedInUser() const { | 27 const user_manager::User* MockUserManager::GetLoggedInUser() const { |
28 return user_list_.empty() ? NULL : user_list_.front(); | 28 return user_list_.empty() ? NULL : user_list_.front(); |
29 } | 29 } |
30 | 30 |
31 user_manager::User* MockUserManager::GetLoggedInUser() { | 31 user_manager::User* MockUserManager::GetLoggedInUser() { |
Dmitry Polukhin
2014/07/28 09:32:39
const?
Nikita (slow)
2014/07/29 09:27:27
../../chrome/browser/chromeos/login/users/user_man
| |
32 return user_list_.empty() ? NULL : user_list_.front(); | 32 return user_list_.empty() ? NULL : user_list_.front(); |
33 } | 33 } |
34 | 34 |
35 user_manager::UserList MockUserManager::GetUnlockUsers() const { | 35 user_manager::UserList MockUserManager::GetUnlockUsers() const { |
36 return user_list_; | 36 return user_list_; |
37 } | 37 } |
38 | 38 |
39 const std::string& MockUserManager::GetOwnerEmail() { | 39 const std::string& MockUserManager::GetOwnerEmail() const { |
40 return GetLoggedInUser()->email(); | 40 return GetLoggedInUser()->email(); |
41 } | 41 } |
42 | 42 |
43 const user_manager::User* MockUserManager::GetActiveUser() const { | 43 const user_manager::User* MockUserManager::GetActiveUser() const { |
44 return GetLoggedInUser(); | 44 return GetLoggedInUser(); |
45 } | 45 } |
46 | 46 |
47 user_manager::User* MockUserManager::GetActiveUser() { | 47 user_manager::User* MockUserManager::GetActiveUser() { |
Dmitry Polukhin
2014/07/28 09:32:38
const?
Nikita (slow)
2014/07/29 09:27:27
Same here.
| |
48 return GetLoggedInUser(); | 48 return GetLoggedInUser(); |
49 } | 49 } |
50 | 50 |
51 const user_manager::User* MockUserManager::GetPrimaryUser() const { | 51 const user_manager::User* MockUserManager::GetPrimaryUser() const { |
52 return GetLoggedInUser(); | 52 return GetLoggedInUser(); |
53 } | 53 } |
54 | 54 |
55 MultiProfileUserController* MockUserManager::GetMultiProfileUserController() { | 55 MultiProfileUserController* MockUserManager::GetMultiProfileUserController() { |
56 return NULL; | 56 return NULL; |
57 } | 57 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
96 | 96 |
97 void MockUserManager::ClearUserList() { | 97 void MockUserManager::ClearUserList() { |
98 // Can't use STLDeleteElements because of the protected destructor of User. | 98 // Can't use STLDeleteElements because of the protected destructor of User. |
99 user_manager::UserList::iterator user; | 99 user_manager::UserList::iterator user; |
100 for (user = user_list_.begin(); user != user_list_.end(); ++user) | 100 for (user = user_list_.begin(); user != user_list_.end(); ++user) |
101 delete *user; | 101 delete *user; |
102 user_list_.clear(); | 102 user_list_.clear(); |
103 } | 103 } |
104 | 104 |
105 } // namespace chromeos | 105 } // namespace chromeos |
OLD | NEW |