Chromium Code Reviews| 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/callback_helpers.h" | |
| 7 #include "base/task_runner.h" | 8 #include "base/task_runner.h" |
| 8 #include "chrome/browser/chromeos/login/users/fake_supervised_user_manager.h" | 9 #include "chrome/browser/chromeos/login/users/fake_supervised_user_manager.h" |
| 9 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 10 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 10 | 11 |
| 11 namespace { | 12 namespace { |
| 12 | 13 |
| 13 class FakeTaskRunner : public base::TaskRunner { | 14 class FakeTaskRunner : public base::TaskRunner { |
| 14 public: | 15 public: |
| 15 bool PostDelayedTask(const tracked_objects::Location& from_here, | 16 bool PostDelayedTask(const tracked_objects::Location& from_here, |
| 16 const base::Closure& task, | 17 base::Closure task, |
| 17 base::TimeDelta delay) override { | 18 base::TimeDelta delay) override { |
| 18 task.Run(); | 19 std::move(task).Run(); |
|
sky
2017/03/22 17:34:11
?
| |
| 19 return true; | 20 return true; |
| 20 } | 21 } |
| 21 bool RunsTasksOnCurrentThread() const override { return true; } | 22 bool RunsTasksOnCurrentThread() const override { return true; } |
| 22 | 23 |
| 23 protected: | 24 protected: |
| 24 ~FakeTaskRunner() override {} | 25 ~FakeTaskRunner() override {} |
| 25 }; | 26 }; |
| 26 | 27 |
| 27 } // namespace | 28 } // namespace |
| 28 | 29 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 136 bool MockUserManager::ShouldReportUser(const std::string& user_id) const { | 137 bool MockUserManager::ShouldReportUser(const std::string& user_id) const { |
| 137 for (auto* user : user_list_) { | 138 for (auto* user : user_list_) { |
| 138 if (user->GetAccountId().GetUserEmail() == user_id) | 139 if (user->GetAccountId().GetUserEmail() == user_id) |
| 139 return user->IsAffiliated(); | 140 return user->IsAffiliated(); |
| 140 } | 141 } |
| 141 NOTREACHED(); | 142 NOTREACHED(); |
| 142 return false; | 143 return false; |
| 143 } | 144 } |
| 144 | 145 |
| 145 } // namespace chromeos | 146 } // namespace chromeos |
| OLD | NEW |