| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #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/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 status.Add(POLICY_LOAD_STATUS_PARSE_ERROR); | 93 status.Add(POLICY_LOAD_STATUS_PARSE_ERROR); |
| 94 } | 94 } |
| 95 } | 95 } |
| 96 | 96 |
| 97 if (!policy_present) | 97 if (!policy_present) |
| 98 status.Add(POLICY_LOAD_STATUS_NO_POLICY); | 98 status.Add(POLICY_LOAD_STATUS_NO_POLICY); |
| 99 | 99 |
| 100 // Load policy for the registered components. | 100 // Load policy for the registered components. |
| 101 LoadPolicyForDomain(POLICY_DOMAIN_EXTENSIONS, "extensions", bundle.get()); | 101 LoadPolicyForDomain(POLICY_DOMAIN_EXTENSIONS, "extensions", bundle.get()); |
| 102 | 102 |
| 103 return bundle.Pass(); | 103 return bundle; |
| 104 } | 104 } |
| 105 | 105 |
| 106 base::Time PolicyLoaderMac::LastModificationTime() { | 106 base::Time PolicyLoaderMac::LastModificationTime() { |
| 107 base::File::Info file_info; | 107 base::File::Info file_info; |
| 108 if (!base::GetFileInfo(managed_policy_path_, &file_info) || | 108 if (!base::GetFileInfo(managed_policy_path_, &file_info) || |
| 109 file_info.is_directory) { | 109 file_info.is_directory) { |
| 110 return base::Time(); | 110 return base::Time(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 return file_info.last_modified; | 113 return file_info.last_modified; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 } | 186 } |
| 187 } | 187 } |
| 188 } | 188 } |
| 189 | 189 |
| 190 void PolicyLoaderMac::OnFileUpdated(const base::FilePath& path, bool error) { | 190 void PolicyLoaderMac::OnFileUpdated(const base::FilePath& path, bool error) { |
| 191 if (!error) | 191 if (!error) |
| 192 Reload(false); | 192 Reload(false); |
| 193 } | 193 } |
| 194 | 194 |
| 195 } // namespace policy | 195 } // namespace policy |
| OLD | NEW |