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 <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 #if defined(OS_WIN) | 96 #if defined(OS_WIN) |
97 scoped_ptr<AsyncPolicyLoader> loader(PolicyLoaderWin::Create( | 97 scoped_ptr<AsyncPolicyLoader> loader(PolicyLoaderWin::Create( |
98 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), | 98 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), |
99 kRegistryChromePolicyKey)); | 99 kRegistryChromePolicyKey)); |
100 return new AsyncPolicyProvider(GetSchemaRegistry(), loader.Pass()); | 100 return new AsyncPolicyProvider(GetSchemaRegistry(), loader.Pass()); |
101 #elif defined(OS_MACOSX) | 101 #elif defined(OS_MACOSX) |
102 scoped_ptr<AsyncPolicyLoader> loader(new PolicyLoaderMac( | 102 scoped_ptr<AsyncPolicyLoader> loader(new PolicyLoaderMac( |
103 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), | 103 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), |
104 GetManagedPolicyPath(), | 104 GetManagedPolicyPath(), |
105 new MacPreferences())); | 105 new MacPreferences())); |
106 return new AsyncPolicyProvider(GetSchemaRegistry(), loader.Pass()); | 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 scoped_ptr<AsyncPolicyLoader> loader(new ConfigDirPolicyLoader( | 110 scoped_ptr<AsyncPolicyLoader> loader(new ConfigDirPolicyLoader( |
111 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), | 111 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), |
112 config_dir_path, | 112 config_dir_path, |
113 POLICY_SCOPE_MACHINE)); | 113 POLICY_SCOPE_MACHINE)); |
114 return new AsyncPolicyProvider(GetSchemaRegistry(), std::move(loader)); | 114 return new AsyncPolicyProvider(GetSchemaRegistry(), std::move(loader)); |
115 } else { | 115 } else { |
116 return NULL; | 116 return NULL; |
117 } | 117 } |
118 #elif defined(OS_ANDROID) | 118 #elif defined(OS_ANDROID) |
119 return new policy::android::AndroidCombinedPolicyProvider( | 119 return new policy::android::AndroidCombinedPolicyProvider( |
120 GetSchemaRegistry()); | 120 GetSchemaRegistry()); |
121 #else | 121 #else |
122 return NULL; | 122 return NULL; |
123 #endif | 123 #endif |
124 } | 124 } |
125 | 125 |
126 } // namespace policy | 126 } // namespace policy |
OLD | NEW |