| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 policy_watcher_->OnFilePathError(path); | 112 policy_watcher_->OnFilePathError(path); |
| 113 } | 113 } |
| 114 } | 114 } |
| 115 | 115 |
| 116 virtual void OnFilePathChanged(const FilePath& path) { | 116 virtual void OnFilePathChanged(const FilePath& path) { |
| 117 if (policy_watcher_) { | 117 if (policy_watcher_) { |
| 118 policy_watcher_->OnFilePathChanged(path); | 118 policy_watcher_->OnFilePathChanged(path); |
| 119 } | 119 } |
| 120 } | 120 } |
| 121 | 121 |
| 122 protected: |
| 123 virtual ~FilePathWatcherDelegate() {} |
| 124 |
| 122 private: | 125 private: |
| 123 base::WeakPtr<NatPolicyLinux> policy_watcher_; | 126 base::WeakPtr<NatPolicyLinux> policy_watcher_; |
| 124 }; | 127 }; |
| 125 | 128 |
| 126 base::Time GetLastModification() { | 129 base::Time GetLastModification() { |
| 127 DCHECK(OnPolicyThread()); | 130 DCHECK(OnPolicyThread()); |
| 128 base::Time last_modification = base::Time(); | 131 base::Time last_modification = base::Time(); |
| 129 base::PlatformFileInfo file_info; | 132 base::PlatformFileInfo file_info; |
| 130 | 133 |
| 131 // If the path does not exist or points to a directory, it's safe to load. | 134 // If the path does not exist or points to a directory, it's safe to load. |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 base::WeakPtrFactory<NatPolicyLinux> weak_factory_; | 268 base::WeakPtrFactory<NatPolicyLinux> weak_factory_; |
| 266 }; | 269 }; |
| 267 | 270 |
| 268 NatPolicy* NatPolicy::Create(base::MessageLoopProxy* message_loop_proxy) { | 271 NatPolicy* NatPolicy::Create(base::MessageLoopProxy* message_loop_proxy) { |
| 269 FilePath policy_dir(kPolicyDir); | 272 FilePath policy_dir(kPolicyDir); |
| 270 return new NatPolicyLinux(message_loop_proxy, policy_dir); | 273 return new NatPolicyLinux(message_loop_proxy, policy_dir); |
| 271 } | 274 } |
| 272 | 275 |
| 273 } // namespace policy_hack | 276 } // namespace policy_hack |
| 274 } // namespace remoting | 277 } // namespace remoting |
| OLD | NEW |