| 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/config_dir_policy_loader.h" | 5 #include "components/policy/core/common/config_dir_policy_loader.h" | 
| 6 | 6 | 
| 7 #include <stddef.h> | 7 #include <stddef.h> | 
| 8 | 8 | 
| 9 #include <algorithm> | 9 #include <algorithm> | 
| 10 #include <set> | 10 #include <set> | 
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 78 } | 78 } | 
| 79 | 79 | 
| 80 scoped_ptr<PolicyBundle> ConfigDirPolicyLoader::Load() { | 80 scoped_ptr<PolicyBundle> ConfigDirPolicyLoader::Load() { | 
| 81   scoped_ptr<PolicyBundle> bundle(new PolicyBundle()); | 81   scoped_ptr<PolicyBundle> bundle(new PolicyBundle()); | 
| 82   LoadFromPath(config_dir_.Append(kMandatoryConfigDir), | 82   LoadFromPath(config_dir_.Append(kMandatoryConfigDir), | 
| 83                POLICY_LEVEL_MANDATORY, | 83                POLICY_LEVEL_MANDATORY, | 
| 84                bundle.get()); | 84                bundle.get()); | 
| 85   LoadFromPath(config_dir_.Append(kRecommendedConfigDir), | 85   LoadFromPath(config_dir_.Append(kRecommendedConfigDir), | 
| 86                POLICY_LEVEL_RECOMMENDED, | 86                POLICY_LEVEL_RECOMMENDED, | 
| 87                bundle.get()); | 87                bundle.get()); | 
| 88   return bundle.Pass(); | 88   return bundle; | 
| 89 } | 89 } | 
| 90 | 90 | 
| 91 base::Time ConfigDirPolicyLoader::LastModificationTime() { | 91 base::Time ConfigDirPolicyLoader::LastModificationTime() { | 
| 92   static const base::FilePath::CharType* kConfigDirSuffixes[] = { | 92   static const base::FilePath::CharType* kConfigDirSuffixes[] = { | 
| 93     kMandatoryConfigDir, | 93     kMandatoryConfigDir, | 
| 94     kRecommendedConfigDir, | 94     kRecommendedConfigDir, | 
| 95   }; | 95   }; | 
| 96 | 96 | 
| 97   base::Time last_modification = base::Time(); | 97   base::Time last_modification = base::Time(); | 
| 98   base::File::Info info; | 98   base::File::Info info; | 
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 227   } | 227   } | 
| 228 } | 228 } | 
| 229 | 229 | 
| 230 void ConfigDirPolicyLoader::OnFileUpdated(const base::FilePath& path, | 230 void ConfigDirPolicyLoader::OnFileUpdated(const base::FilePath& path, | 
| 231                                           bool error) { | 231                                           bool error) { | 
| 232   if (!error) | 232   if (!error) | 
| 233     Reload(false); | 233     Reload(false); | 
| 234 } | 234 } | 
| 235 | 235 | 
| 236 }  // namespace policy | 236 }  // namespace policy | 
| OLD | NEW | 
|---|