Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: chrome/browser/chromeos/login/users/mock_user_manager.cc

Issue 2122543002: Replace Closure in TaskRunner::PostTask with OneShotCallback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@07_oneshot
Patch Set: fix Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
11 namespace { 11 namespace {
12 12
13 class FakeTaskRunner : public base::TaskRunner { 13 class FakeTaskRunner : public base::TaskRunner {
14 public: 14 public:
15 bool PostDelayedTask(const tracked_objects::Location& from_here, 15 bool PostDelayedTask(const tracked_objects::Location& from_here,
16 const base::Closure& task, 16 base::OnceClosure task,
17 base::TimeDelta delay) override { 17 base::TimeDelta delay) override {
18 task.Run(); 18 std::move(task).Run();
19 return true; 19 return true;
20 } 20 }
21 bool RunsTasksOnCurrentThread() const override { return true; } 21 bool RunsTasksOnCurrentThread() const override { return true; }
22 22
23 protected: 23 protected:
24 ~FakeTaskRunner() override {} 24 ~FakeTaskRunner() override {}
25 }; 25 };
26 26
27 } // namespace 27 } // namespace
28 28
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 bool MockUserManager::ShouldReportUser(const std::string& user_id) const { 145 bool MockUserManager::ShouldReportUser(const std::string& user_id) const {
146 for (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
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/memory/tab_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698