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

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

Issue 8586030: Added ConfigurationPolicyProvider::RefreshPolicies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 9 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/file_based_policy_loader.h" 5 #include "chrome/browser/policy/file_based_policy_loader.h"
6 6
7 #include "base/files/file_path_watcher.h" 7 #include "base/files/file_path_watcher.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 66
67 void FileBasedPolicyLoader::OnFilePathError(const FilePath& path) { 67 void FileBasedPolicyLoader::OnFilePathError(const FilePath& path) {
68 LOG(ERROR) << "FilePathWatcher on " << path.value() 68 LOG(ERROR) << "FilePathWatcher on " << path.value()
69 << " failed."; 69 << " failed.";
70 } 70 }
71 71
72 void FileBasedPolicyLoader::Reload(bool force) { 72 void FileBasedPolicyLoader::Reload(bool force) {
73 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 73 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
74 74
75 if (!delegate()) 75 if (!delegate()) {
76 PostUpdatePolicyTask(NULL);
76 return; 77 return;
78 }
77 79
78 // Check the directory time in order to see whether a reload is required. 80 // Check the directory time in order to see whether a reload is required.
79 base::TimeDelta delay; 81 base::TimeDelta delay;
80 base::Time now = base::Time::Now(); 82 base::Time now = base::Time::Now();
81 if (!force && !IsSafeToReloadPolicy(now, &delay)) { 83 if (!force && !IsSafeToReloadPolicy(now, &delay)) {
82 ScheduleReloadTask(delay); 84 ScheduleReloadTask(delay);
83 return; 85 return;
84 } 86 }
85 87
86 // Load the policy definitions. 88 // Load the policy definitions.
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 base::TimeDelta age = now - last_modification_clock_; 145 base::TimeDelta age = now - last_modification_clock_;
144 if (age < settle_interval_) { 146 if (age < settle_interval_) {
145 *delay = settle_interval_ - age; 147 *delay = settle_interval_ - age;
146 return false; 148 return false;
147 } 149 }
148 150
149 return true; 151 return true;
150 } 152 }
151 153
152 } // namespace policy 154 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/device_policy_cache.cc ('k') | chrome/browser/policy/file_based_policy_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698