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

Side by Side Diff: remoting/host/policy_watcher.cc

Issue 959033002: Making Chromoting use no GPO provider in PolicyLoaderWin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2311
Patch Set: Created 5 years, 10 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
« no previous file with comments | « components/policy/core/common/policy_loader_win_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 // Most of this code is copied from: 5 // Most of this code is copied from:
6 // src/chrome/browser/policy/asynchronous_policy_loader.{h,cc} 6 // src/chrome/browser/policy/asynchronous_policy_loader.{h,cc}
7 7
8 #include "remoting/host/policy_watcher.h" 8 #include "remoting/host/policy_watcher.h"
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 return make_scoped_ptr( 259 return make_scoped_ptr(
260 new PolicyWatcher(policy_service, nullptr, nullptr, nullptr)); 260 new PolicyWatcher(policy_service, nullptr, nullptr, nullptr));
261 #else // !defined(OS_CHROMEOS) 261 #else // !defined(OS_CHROMEOS)
262 DCHECK(!policy_service); 262 DCHECK(!policy_service);
263 263
264 // Create platform-specific PolicyLoader. Always read the Chrome policies 264 // Create platform-specific PolicyLoader. Always read the Chrome policies
265 // (even on Chromium) so that policy enforcement can't be bypassed by running 265 // (even on Chromium) so that policy enforcement can't be bypassed by running
266 // Chromium. 266 // Chromium.
267 scoped_ptr<policy::AsyncPolicyLoader> policy_loader; 267 scoped_ptr<policy::AsyncPolicyLoader> policy_loader;
268 #if defined(OS_WIN) 268 #if defined(OS_WIN)
269 policy_loader = policy::PolicyLoaderWin::Create( 269 policy_loader.reset(new policy::PolicyLoaderWin(
270 file_task_runner, L"SOFTWARE\\Policies\\Google\\Chrome"); 270 file_task_runner, L"SOFTWARE\\Policies\\Google\\Chrome",
271 nullptr)); // nullptr = don't use GPO / always read from the registry.
271 #elif defined(OS_MACOSX) 272 #elif defined(OS_MACOSX)
272 CFStringRef bundle_id = CFSTR("com.google.Chrome"); 273 CFStringRef bundle_id = CFSTR("com.google.Chrome");
273 policy_loader.reset(new policy::PolicyLoaderMac( 274 policy_loader.reset(new policy::PolicyLoaderMac(
274 file_task_runner, 275 file_task_runner,
275 policy::PolicyLoaderMac::GetManagedPolicyPath(bundle_id), 276 policy::PolicyLoaderMac::GetManagedPolicyPath(bundle_id),
276 new MacPreferences(), bundle_id)); 277 new MacPreferences(), bundle_id));
277 #elif defined(OS_POSIX) && !defined(OS_ANDROID) 278 #elif defined(OS_POSIX) && !defined(OS_ANDROID)
278 policy_loader.reset(new policy::ConfigDirPolicyLoader( 279 policy_loader.reset(new policy::ConfigDirPolicyLoader(
279 file_task_runner, 280 file_task_runner,
280 base::FilePath(FILE_PATH_LITERAL("/etc/opt/chrome/policies")), 281 base::FilePath(FILE_PATH_LITERAL("/etc/opt/chrome/policies")),
281 policy::POLICY_SCOPE_MACHINE)); 282 policy::POLICY_SCOPE_MACHINE));
282 #else 283 #else
283 #error OS that is not yet supported by PolicyWatcher code. 284 #error OS that is not yet supported by PolicyWatcher code.
284 #endif 285 #endif
285 286
286 return PolicyWatcher::CreateFromPolicyLoader(policy_loader.Pass()); 287 return PolicyWatcher::CreateFromPolicyLoader(policy_loader.Pass());
287 #endif // !(OS_CHROMEOS) 288 #endif // !(OS_CHROMEOS)
288 } 289 }
289 290
290 } // namespace remoting 291 } // namespace remoting
OLDNEW
« no previous file with comments | « components/policy/core/common/policy_loader_win_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698