| 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 "base/task_runner.h" | 7 #include "base/task_runner.h" |
| 8 #include "chrome/browser/chromeos/login/users/fake_supervised_user_manager.h" | 8 #include "chrome/browser/chromeos/login/users/fake_supervised_user_manager.h" |
| 9 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 9 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 10 | 10 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 void MockUserManager::ClearUserList() { | 137 void MockUserManager::ClearUserList() { |
| 138 // Can't use STLDeleteElements because of the protected destructor of User. | 138 // Can't use STLDeleteElements because of the protected destructor of User. |
| 139 for (user_manager::UserList::iterator user = user_list_.begin(); | 139 for (user_manager::UserList::iterator user = user_list_.begin(); |
| 140 user != user_list_.end(); ++user) | 140 user != user_list_.end(); ++user) |
| 141 delete *user; | 141 delete *user; |
| 142 user_list_.clear(); | 142 user_list_.clear(); |
| 143 } | 143 } |
| 144 | 144 |
| 145 bool MockUserManager::ShouldReportUser(const std::string& user_id) const { | 145 bool MockUserManager::ShouldReportUser(const std::string& user_id) const { |
| 146 for (const auto& user : user_list_) { | 146 for (auto* user : user_list_) { |
| 147 if (user->email() == user_id) | 147 if (user->email() == user_id) |
| 148 return user->IsAffiliated(); | 148 return user->IsAffiliated(); |
| 149 } | 149 } |
| 150 NOTREACHED(); | 150 NOTREACHED(); |
| 151 return false; | 151 return false; |
| 152 } | 152 } |
| 153 | 153 |
| 154 } // namespace chromeos | 154 } // namespace chromeos |
| OLD | NEW |