Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: chrome/browser/policy/config_dir_policy_provider.cc

Issue 6074003: Handle policy refresh internally in ConfigurationPolicyPrefStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/policy/config_dir_policy_provider.h" 5 #include "chrome/browser/policy/config_dir_policy_provider.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 // Enumerate the files and find the most recent modification timestamp. 63 // Enumerate the files and find the most recent modification timestamp.
64 file_util::FileEnumerator file_enumerator(config_file_path(), 64 file_util::FileEnumerator file_enumerator(config_file_path(),
65 false, 65 false,
66 file_util::FileEnumerator::FILES); 66 file_util::FileEnumerator::FILES);
67 for (FilePath config_file = file_enumerator.Next(); 67 for (FilePath config_file = file_enumerator.Next();
68 !config_file.empty(); 68 !config_file.empty();
69 config_file = file_enumerator.Next()) { 69 config_file = file_enumerator.Next()) {
70 if (file_util::GetFileInfo(config_file, &file_info) && 70 if (file_util::GetFileInfo(config_file, &file_info) &&
71 !file_info.is_directory) { 71 !file_info.is_directory) {
72 last_modification = std::min(last_modification, file_info.last_modified); 72 last_modification = std::max(last_modification, file_info.last_modified);
danno 2010/12/22 14:00:19 unlrelated to this CL?
Mattias Nissler (ping if slow) 2010/12/22 14:11:04 Yes, but fixes the problem that we reload to often
73 } 73 }
74 } 74 }
75 75
76 return last_modification; 76 return last_modification;
77 } 77 }
78 78
79 ConfigDirPolicyProvider::ConfigDirPolicyProvider( 79 ConfigDirPolicyProvider::ConfigDirPolicyProvider(
80 const ConfigurationPolicyProvider::PolicyDefinitionList* policy_list, 80 const ConfigurationPolicyProvider::PolicyDefinitionList* policy_list,
81 const FilePath& config_dir) 81 const FilePath& config_dir)
82 : FileBasedPolicyProvider( 82 : FileBasedPolicyProvider(
83 policy_list, 83 policy_list,
84 new ConfigDirPolicyProviderDelegate(config_dir)) { 84 new ConfigDirPolicyProviderDelegate(config_dir)) {
85 } 85 }
86 86
87 } // namespace policy 87 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698