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

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

Issue 18348016: If requested, report network interfaces to management server. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Finishing touches. Created 7 years, 5 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/settings/device_settings_provider.cc
diff --git a/chrome/browser/chromeos/settings/device_settings_provider.cc b/chrome/browser/chromeos/settings/device_settings_provider.cc
index 98293ad351e496ed116b6cd0aef3b25dc5e0aaec..ae01d511e68900b21d24d87cba706491825a791e 100644
--- a/chrome/browser/chromeos/settings/device_settings_provider.cc
+++ b/chrome/browser/chromeos/settings/device_settings_provider.cc
@@ -62,6 +62,7 @@ const char* kKnownSettings[] = {
kReportDeviceActivityTimes,
kReportDeviceBootMode,
kReportDeviceLocation,
+ kReportDeviceNetworkInterfaces,
kReportDeviceVersionInfo,
kScreenSaverExtensionId,
kScreenSaverTimeout,
@@ -378,6 +379,7 @@ void DeviceSettingsProvider::SetInPolicy() {
// kReportDeviceBootMode
// kReportDeviceLocation
// kReportDeviceVersionInfo
+ // kReportDeviceNetworkInterfaces
// kScreenSaverExtensionId
// kScreenSaverTimeout
// kStartUpUrls
@@ -612,50 +614,50 @@ void DeviceSettingsProvider::DecodeNetworkPolicies(
void DeviceSettingsProvider::DecodeAutoUpdatePolicies(
const em::ChromeDeviceSettingsProto& policy,
PrefValueMap* new_values_cache) const {
- if (!policy.has_auto_update_settings())
- return;
- const em::AutoUpdateSettingsProto& au_settings_proto =
- policy.auto_update_settings();
- if (au_settings_proto.has_update_disabled()) {
- new_values_cache->SetBoolean(kUpdateDisabled,
- au_settings_proto.update_disabled());
- }
- const RepeatedField<int>& allowed_connection_types =
- au_settings_proto.allowed_connection_types();
- base::ListValue* list = new base::ListValue();
- for (RepeatedField<int>::const_iterator i = allowed_connection_types.begin(),
- e = allowed_connection_types.end(); i != e; ++i) {
- list->Append(new base::FundamentalValue(*i));
+ if (policy.has_auto_update_settings()) {
+ const em::AutoUpdateSettingsProto& au_settings_proto =
+ policy.auto_update_settings();
+ if (au_settings_proto.has_update_disabled()) {
+ new_values_cache->SetBoolean(kUpdateDisabled,
+ au_settings_proto.update_disabled());
+ }
+ const RepeatedField<int>& allowed_connection_types =
+ au_settings_proto.allowed_connection_types();
+ base::ListValue* list = new base::ListValue();
+ for (RepeatedField<int>::const_iterator i(allowed_connection_types.begin());
+ i != allowed_connection_types.end(); ++i) {
+ list->Append(new base::FundamentalValue(*i));
+ }
+ new_values_cache->SetValue(kAllowedConnectionTypesForUpdate, list);
}
- new_values_cache->SetValue(kAllowedConnectionTypesForUpdate, list);
}
void DeviceSettingsProvider::DecodeReportingPolicies(
const em::ChromeDeviceSettingsProto& policy,
PrefValueMap* new_values_cache) const {
if (policy.has_device_reporting()) {
- if (policy.device_reporting().has_report_version_info()) {
+ const em::DeviceReportingProto& reporting_policy =
+ policy.device_reporting();
+ if (reporting_policy.has_report_version_info()) {
new_values_cache->SetBoolean(
kReportDeviceVersionInfo,
- policy.device_reporting().report_version_info());
+ reporting_policy.report_version_info());
}
- if (policy.device_reporting().has_report_activity_times()) {
+ if (reporting_policy.has_report_activity_times()) {
new_values_cache->SetBoolean(
kReportDeviceActivityTimes,
- policy.device_reporting().report_activity_times());
+ reporting_policy.report_activity_times());
}
- if (policy.device_reporting().has_report_boot_mode()) {
+ if (reporting_policy.has_report_boot_mode()) {
new_values_cache->SetBoolean(
kReportDeviceBootMode,
- policy.device_reporting().report_boot_mode());
+ reporting_policy.report_boot_mode());
+ }
+ if (reporting_policy.has_report_network_interfaces()) {
+ new_values_cache->SetBoolean(
+ kReportDeviceNetworkInterfaces,
+ reporting_policy.report_network_interfaces());
}
- // Device location reporting needs to pass privacy review before it can be
- // enabled. crosbug.com/24681
- // if (policy.device_reporting().has_report_location()) {
- // new_values_cache->SetBoolean(
- // kReportDeviceLocation,
- // policy.device_reporting().report_location());
- // }
}
}

Powered by Google App Engine
This is Rietveld 408576698