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

Unified Diff: chrome/browser/chromeos/device_settings_provider.cc

Issue 9289017: Apply individual policies for the various parts of device status reports. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Julian's comments. Created 8 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/chromeos/device_settings_provider.cc
diff --git a/chrome/browser/chromeos/device_settings_provider.cc b/chrome/browser/chromeos/device_settings_provider.cc
index 51d6dc6b433473eb6e50153703f1a2acaeae2c70..1d1b8921bf91a35e68df81cdf8cbe1cee4c84901 100644
--- a/chrome/browser/chromeos/device_settings_provider.cc
+++ b/chrome/browser/chromeos/device_settings_provider.cc
@@ -41,7 +41,10 @@ const char* kBooleanSettings[] = {
kAccountsPrefAllowGuest,
kAccountsPrefShowUserNamesOnSignIn,
kSignedDataRoamingEnabled,
- kStatsReportingPref
+ kStatsReportingPref,
+ kReportDeviceVersionInfo,
+ kReportDeviceActivityTimes,
+ kReportDeviceBootMode
};
const char* kStringSettings[] = {
@@ -281,6 +284,9 @@ void DeviceSettingsProvider::SetInPolicy() {
whitelist_proto->add_user_whitelist(email.c_str());
}
} else {
+ // kReportDeviceVersionInfo, kReportDeviceActivityTimes, and
+ // kReportDeviceBootMode do not support being set in the policy, since
+ // they are not intended to be user-controlled.
NOTREACHED();
}
data.set_policy_value(pol.SerializeAsString());
@@ -403,6 +409,21 @@ void DeviceSettingsProvider::UpdateValuesCache() {
}
new_values_cache.SetValue(kAccountsPrefUsers, list);
+ if (pol.has_device_reporting()) {
+ if (pol.device_reporting().has_report_version_info()) {
+ new_values_cache.SetBoolean(kReportDeviceVersionInfo,
+ pol.device_reporting().report_version_info());
+ }
+ if (pol.device_reporting().has_report_activity_times()) {
+ new_values_cache.SetBoolean(kReportDeviceActivityTimes,
+ pol.device_reporting().report_activity_times());
+ }
+ if (pol.device_reporting().has_report_boot_mode()) {
+ new_values_cache.SetBoolean(kReportDeviceBootMode,
+ pol.device_reporting().report_boot_mode());
+ }
+ }
+
// Collect all notifications but send them only after we have swapped the
// cache so that if somebody actually reads the cache will be already valid.
std::vector<std::string> notifications;
« no previous file with comments | « chrome/browser/chromeos/cros_settings_provider.cc ('k') | chrome/browser/chromeos/stub_cros_settings_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698