OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/cloud/user_cloud_policy_manager_factory.h" | 5 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 // A KeyedService that wraps a UserCloudPolicyManager. | 36 // A KeyedService that wraps a UserCloudPolicyManager. |
37 class UserCloudPolicyManagerFactory::ManagerWrapper : public KeyedService { | 37 class UserCloudPolicyManagerFactory::ManagerWrapper : public KeyedService { |
38 public: | 38 public: |
39 explicit ManagerWrapper(UserCloudPolicyManager* manager) | 39 explicit ManagerWrapper(UserCloudPolicyManager* manager) |
40 : manager_(manager) { | 40 : manager_(manager) { |
41 DCHECK(manager); | 41 DCHECK(manager); |
42 } | 42 } |
43 virtual ~ManagerWrapper() {} | 43 virtual ~ManagerWrapper() {} |
44 | 44 |
45 virtual void Shutdown() OVERRIDE { | 45 virtual void Shutdown() override { |
46 manager_->Shutdown(); | 46 manager_->Shutdown(); |
47 } | 47 } |
48 | 48 |
49 UserCloudPolicyManager* manager() { return manager_; } | 49 UserCloudPolicyManager* manager() { return manager_; } |
50 | 50 |
51 private: | 51 private: |
52 UserCloudPolicyManager* manager_; | 52 UserCloudPolicyManager* manager_; |
53 | 53 |
54 DISALLOW_COPY_AND_ASSIGN(ManagerWrapper); | 54 DISALLOW_COPY_AND_ASSIGN(ManagerWrapper); |
55 }; | 55 }; |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 return testing_factory_ != NULL; | 212 return testing_factory_ != NULL; |
213 } | 213 } |
214 | 214 |
215 void UserCloudPolicyManagerFactory::CreateServiceNow( | 215 void UserCloudPolicyManagerFactory::CreateServiceNow( |
216 content::BrowserContext* context) { | 216 content::BrowserContext* context) { |
217 DCHECK(testing_factory_); | 217 DCHECK(testing_factory_); |
218 manager_wrappers_[context] = new ManagerWrapper(testing_factory_(context)); | 218 manager_wrappers_[context] = new ManagerWrapper(testing_factory_(context)); |
219 } | 219 } |
220 | 220 |
221 } // namespace policy | 221 } // namespace policy |
OLD | NEW |