| 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 // Most of this code is copied from various classes in | 5 // Most of this code is copied from various classes in |
| 6 // src/chrome/browser/policy. In particular, look at | 6 // src/chrome/browser/policy. In particular, look at |
| 7 // | 7 // |
| 8 // file_based_policy_loader.{h,cc} | 8 // file_based_policy_loader.{h,cc} |
| 9 // config_dir_policy_provider.{h,cc} | 9 // config_dir_policy_provider.{h,cc} |
| 10 // | 10 // |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "base/synchronization/waitable_event.h" | 26 #include "base/synchronization/waitable_event.h" |
| 27 #include "base/time.h" | 27 #include "base/time.h" |
| 28 #include "base/values.h" | 28 #include "base/values.h" |
| 29 | 29 |
| 30 namespace remoting { | 30 namespace remoting { |
| 31 namespace policy_hack { | 31 namespace policy_hack { |
| 32 | 32 |
| 33 namespace { | 33 namespace { |
| 34 | 34 |
| 35 const FilePath::CharType kPolicyDir[] = | 35 const FilePath::CharType kPolicyDir[] = |
| 36 FILE_PATH_LITERAL("/etc/opt/chrome/policies/managed"); | 36 // Always read the Chrome policies (even on Chromium) so that policy |
| 37 // enforcement can't be bypassed by running Chromium. |
| 38 FILE_PATH_LITERAL("/etc/opt/chrome/policies/managed"); |
| 37 | 39 |
| 38 // Amount of time we wait for the files on disk to settle before trying to load | 40 // Amount of time we wait for the files on disk to settle before trying to load |
| 39 // them. This alleviates the problem of reading partially written files and | 41 // them. This alleviates the problem of reading partially written files and |
| 40 // makes it possible to batch quasi-simultaneous changes. | 42 // makes it possible to batch quasi-simultaneous changes. |
| 41 const int kSettleIntervalSeconds = 5; | 43 const int kSettleIntervalSeconds = 5; |
| 42 | 44 |
| 43 } // namespace | 45 } // namespace |
| 44 | 46 |
| 45 class PolicyWatcherLinux : public PolicyWatcher { | 47 class PolicyWatcherLinux : public PolicyWatcher { |
| 46 public: | 48 public: |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 }; | 271 }; |
| 270 | 272 |
| 271 PolicyWatcher* PolicyWatcher::Create( | 273 PolicyWatcher* PolicyWatcher::Create( |
| 272 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { | 274 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { |
| 273 FilePath policy_dir(kPolicyDir); | 275 FilePath policy_dir(kPolicyDir); |
| 274 return new PolicyWatcherLinux(task_runner, policy_dir); | 276 return new PolicyWatcherLinux(task_runner, policy_dir); |
| 275 } | 277 } |
| 276 | 278 |
| 277 } // namespace policy_hack | 279 } // namespace policy_hack |
| 278 } // namespace remoting | 280 } // namespace remoting |
| OLD | NEW |