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 18 matching lines...) Expand all Loading... |
29 } | 29 } |
30 | 30 |
31 user_manager::User* MockUserManager::GetLoggedInUser() { | 31 user_manager::User* MockUserManager::GetLoggedInUser() { |
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() { |
48 return GetLoggedInUser(); | 48 return GetLoggedInUser(); |
49 } | 49 } |
(...skipping 46 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 |