| 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 #include "components/policy/core/common/policy_loader_mac.h" | 5 #include "components/policy/core/common/policy_loader_mac.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 if (!policy_present) | 112 if (!policy_present) |
| 113 status.Add(POLICY_LOAD_STATUS_NO_POLICY); | 113 status.Add(POLICY_LOAD_STATUS_NO_POLICY); |
| 114 | 114 |
| 115 // Load policy for the registered components. | 115 // Load policy for the registered components. |
| 116 LoadPolicyForDomain(POLICY_DOMAIN_EXTENSIONS, "extensions", bundle.get()); | 116 LoadPolicyForDomain(POLICY_DOMAIN_EXTENSIONS, "extensions", bundle.get()); |
| 117 | 117 |
| 118 return bundle.Pass(); | 118 return bundle.Pass(); |
| 119 } | 119 } |
| 120 | 120 |
| 121 base::Time PolicyLoaderMac::LastModificationTime() { | 121 base::Time PolicyLoaderMac::LastModificationTime() { |
| 122 base::PlatformFileInfo file_info; | 122 base::File::Info file_info; |
| 123 if (!base::GetFileInfo(managed_policy_path_, &file_info) || | 123 if (!base::GetFileInfo(managed_policy_path_, &file_info) || |
| 124 file_info.is_directory) { | 124 file_info.is_directory) { |
| 125 return base::Time(); | 125 return base::Time(); |
| 126 } | 126 } |
| 127 | 127 |
| 128 return file_info.last_modified; | 128 return file_info.last_modified; |
| 129 } | 129 } |
| 130 | 130 |
| 131 // static | 131 // static |
| 132 base::Value* PolicyLoaderMac::CreateValueFromProperty( | 132 base::Value* PolicyLoaderMac::CreateValueFromProperty( |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 } | 225 } |
| 226 } | 226 } |
| 227 } | 227 } |
| 228 | 228 |
| 229 void PolicyLoaderMac::OnFileUpdated(const base::FilePath& path, bool error) { | 229 void PolicyLoaderMac::OnFileUpdated(const base::FilePath& path, bool error) { |
| 230 if (!error) | 230 if (!error) |
| 231 Reload(false); | 231 Reload(false); |
| 232 } | 232 } |
| 233 | 233 |
| 234 } // namespace policy | 234 } // namespace policy |
| OLD | NEW |