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/policy/chrome_browser_policy_connector.h" | 5 #include "chrome/browser/policy/chrome_browser_policy_connector.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 device_management_service->ScheduleInitialization( | 89 device_management_service->ScheduleInitialization( |
90 kServiceInitializationStartupDelay); | 90 kServiceInitializationStartupDelay); |
91 | 91 |
92 InitInternal(local_state, std::move(device_management_service)); | 92 InitInternal(local_state, std::move(device_management_service)); |
93 } | 93 } |
94 | 94 |
95 ConfigurationPolicyProvider* | 95 ConfigurationPolicyProvider* |
96 ChromeBrowserPolicyConnector::CreatePlatformProvider() { | 96 ChromeBrowserPolicyConnector::CreatePlatformProvider() { |
97 #if defined(OS_WIN) | 97 #if defined(OS_WIN) |
98 std::unique_ptr<AsyncPolicyLoader> loader(PolicyLoaderWin::Create( | 98 std::unique_ptr<AsyncPolicyLoader> loader(PolicyLoaderWin::Create( |
99 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), | 99 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), |
100 kRegistryChromePolicyKey)); | 100 kRegistryChromePolicyKey)); |
101 return new AsyncPolicyProvider(GetSchemaRegistry(), std::move(loader)); | 101 return new AsyncPolicyProvider(GetSchemaRegistry(), std::move(loader)); |
102 #elif defined(OS_MACOSX) | 102 #elif defined(OS_MACOSX) |
103 std::unique_ptr<AsyncPolicyLoader> loader(new PolicyLoaderMac( | 103 std::unique_ptr<AsyncPolicyLoader> loader(new PolicyLoaderMac( |
104 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), | 104 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), |
105 GetManagedPolicyPath(), new MacPreferences())); | 105 GetManagedPolicyPath(), new MacPreferences())); |
106 return new AsyncPolicyProvider(GetSchemaRegistry(), std::move(loader)); | 106 return new AsyncPolicyProvider(GetSchemaRegistry(), std::move(loader)); |
107 #elif defined(OS_POSIX) && !defined(OS_ANDROID) | 107 #elif defined(OS_POSIX) && !defined(OS_ANDROID) |
108 base::FilePath config_dir_path; | 108 base::FilePath config_dir_path; |
109 if (PathService::Get(chrome::DIR_POLICY_FILES, &config_dir_path)) { | 109 if (PathService::Get(chrome::DIR_POLICY_FILES, &config_dir_path)) { |
110 std::unique_ptr<AsyncPolicyLoader> loader(new ConfigDirPolicyLoader( | 110 std::unique_ptr<AsyncPolicyLoader> loader(new ConfigDirPolicyLoader( |
111 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), | 111 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), |
112 config_dir_path, POLICY_SCOPE_MACHINE)); | 112 config_dir_path, POLICY_SCOPE_MACHINE)); |
113 return new AsyncPolicyProvider(GetSchemaRegistry(), std::move(loader)); | 113 return new AsyncPolicyProvider(GetSchemaRegistry(), std::move(loader)); |
114 } else { | 114 } else { |
115 return NULL; | 115 return NULL; |
116 } | 116 } |
117 #elif defined(OS_ANDROID) | 117 #elif defined(OS_ANDROID) |
118 return new policy::android::AndroidCombinedPolicyProvider( | 118 return new policy::android::AndroidCombinedPolicyProvider( |
119 GetSchemaRegistry()); | 119 GetSchemaRegistry()); |
120 #else | 120 #else |
121 return NULL; | 121 return NULL; |
122 #endif | 122 #endif |
123 } | 123 } |
124 | 124 |
125 } // namespace policy | 125 } // namespace policy |
OLD | NEW |