OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/policy/asynchronous_policy_loader.h" | 5 #include "chrome/browser/policy/asynchronous_policy_loader.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/task.h" | 8 #include "base/task.h" |
9 | 9 |
10 namespace policy { | 10 namespace policy { |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 void AsynchronousPolicyLoader::Stop() { | 22 void AsynchronousPolicyLoader::Stop() { |
23 delegate_.reset(); | 23 delegate_.reset(); |
24 } | 24 } |
25 | 25 |
26 void AsynchronousPolicyLoader::SetProvider( | 26 void AsynchronousPolicyLoader::SetProvider( |
27 AsynchronousPolicyProvider* provider) { | 27 AsynchronousPolicyProvider* provider) { |
28 provider_ = provider; | 28 provider_ = provider; |
29 } | 29 } |
30 | 30 |
| 31 AsynchronousPolicyLoader::~AsynchronousPolicyLoader() { |
| 32 } |
| 33 |
31 // Manages the life cycle of a new policy map during until it's life cycle is | 34 // Manages the life cycle of a new policy map during until it's life cycle is |
32 // taken over by the policy loader. | 35 // taken over by the policy loader. |
33 class UpdatePolicyTask : public Task { | 36 class UpdatePolicyTask : public Task { |
34 public: | 37 public: |
35 UpdatePolicyTask(scoped_refptr<AsynchronousPolicyLoader> loader, | 38 UpdatePolicyTask(scoped_refptr<AsynchronousPolicyLoader> loader, |
36 DictionaryValue* new_policy) | 39 DictionaryValue* new_policy) |
37 : loader_(loader), | 40 : loader_(loader), |
38 new_policy_(new_policy) {} | 41 new_policy_(new_policy) {} |
39 | 42 |
40 virtual void Run() { | 43 virtual void Run() { |
(...skipping 25 matching lines...) Expand all Loading... |
66 policy_.reset(new_policy.release()); | 69 policy_.reset(new_policy.release()); |
67 // TODO(danno): Change the notification between the provider and the | 70 // TODO(danno): Change the notification between the provider and the |
68 // PrefStore into a notification mechanism, removing the need for the | 71 // PrefStore into a notification mechanism, removing the need for the |
69 // WeakPtr for the provider. | 72 // WeakPtr for the provider. |
70 if (provider_) | 73 if (provider_) |
71 provider_->NotifyStoreOfPolicyChange(); | 74 provider_->NotifyStoreOfPolicyChange(); |
72 } | 75 } |
73 } | 76 } |
74 | 77 |
75 } // namespace policy | 78 } // namespace policy |
OLD | NEW |