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

Side by Side Diff: components/policy/core/common/fake_async_policy_loader.cc

Issue 858303003: Removing FakePolicyWatcher and introducing FakeAsyncPolicyLoader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweaked the set of #include-s. Created 5 years, 11 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/policy/core/common/fake_async_policy_loader.h"
6
7 #include "base/bind.h"
8 #include "base/location.h"
9
10 namespace policy {
11
12 FakeAsyncPolicyLoader::FakeAsyncPolicyLoader(
13 scoped_refptr<base::SequencedTaskRunner> task_runner)
14 : AsyncPolicyLoader(task_runner) {
15 }
16
17 scoped_ptr<PolicyBundle> FakeAsyncPolicyLoader::Load() {
18 scoped_ptr<PolicyBundle> result(new PolicyBundle());
19 result->CopyFrom(policy_bundle_);
20 return result.Pass();
21 }
22
23 void FakeAsyncPolicyLoader::InitOnBackgroundThread() {
24 // Nothing to do.
25 }
26
27 void FakeAsyncPolicyLoader::SetPolicies(const PolicyBundle& policy_bundle) {
28 policy_bundle_.CopyFrom(policy_bundle);
29 }
30
31 void FakeAsyncPolicyLoader::PostReloadOnBackgroundThread(bool force) {
32 task_runner()->PostTask(FROM_HERE, base::Bind(&AsyncPolicyLoader::Reload,
33 base::Unretained(this), force));
34 }
35
36 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698