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

Unified Diff: chrome/browser/policy/device_management_policy_cache.cc

Issue 6310012: Allow policy refresh rate to be configured through policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit test. Created 9 years, 11 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/policy/device_management_policy_cache.cc
diff --git a/chrome/browser/policy/device_management_policy_cache.cc b/chrome/browser/policy/device_management_policy_cache.cc
index ff072eb150ccdba466aa128378e897c35b829e96..75f72bf4ce746dfc5cdf07470cebafcd1bf190d8 100644
--- a/chrome/browser/policy/device_management_policy_cache.cc
+++ b/chrome/browser/policy/device_management_policy_cache.cc
@@ -138,26 +138,18 @@ DictionaryValue* DeviceManagementPolicyCache::GetPolicy() {
return policy_->DeepCopy();
}
-void DeviceManagementPolicyCache::SetDeviceUnmanaged(bool is_device_unmanaged) {
- if (is_device_unmanaged_ == is_device_unmanaged)
- return;
-
- is_device_unmanaged_ = is_device_unmanaged;
+void DeviceManagementPolicyCache::SetDeviceUnmanaged() {
+ is_device_unmanaged_ = true;
base::Time now(base::Time::NowFromSystemTime());
- DictionaryValue* empty = new DictionaryValue();
{
AutoLock lock(lock_);
- policy_.reset(empty);
+ policy_.reset(new DictionaryValue);
last_policy_refresh_time_ = now;
}
BrowserThread::PostTask(
BrowserThread::FILE,
FROM_HERE,
- new PersistPolicyTask(backing_file_path_,
- (is_device_unmanaged ? NULL
- : new em::DevicePolicyResponse()),
- now,
- is_device_unmanaged_));
+ new PersistPolicyTask(backing_file_path_, NULL, now, true));
}
// static
« no previous file with comments | « chrome/browser/policy/device_management_policy_cache.h ('k') | chrome/browser/policy/device_management_policy_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698