diff options
author | dubroy@chromium.org <dubroy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-25 14:03:25 +0000 |
---|---|---|
committer | dubroy@chromium.org <dubroy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-25 14:03:25 +0000 |
commit | 9f521e599e65cfd1792fd3c0f0cd9af176183f1b (patch) | |
tree | 803edc1cfacce8a2b1f3f1686baa95415d74050d | |
parent | 07c6ba51672b3e41203dfac010e91e742d6348e3 (diff) | |
download | chromium_src-9f521e599e65cfd1792fd3c0f0cd9af176183f1b.zip chromium_src-9f521e599e65cfd1792fd3c0f0cd9af176183f1b.tar.gz chromium_src-9f521e599e65cfd1792fd3c0f0cd9af176183f1b.tar.bz2 |
Add policies for specific parts of device status reports.
BUG=chromium-os:24308
TEST=Manual
Review URL: https://chromiumcodereview.appspot.com/9284025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119058 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/app/policy/policy_templates.json | 28 | ||||
-rw-r--r-- | chrome/browser/policy/configuration_policy_handler_list.cc | 6 | ||||
-rw-r--r-- | chrome/browser/policy/device_policy_cache.cc | 18 | ||||
-rw-r--r-- | chrome/browser/policy/proto/chrome_device_policy.proto | 7 | ||||
-rw-r--r-- | chrome/common/pref_names.cc | 8 | ||||
-rw-r--r-- | chrome/common/pref_names.h | 2 |
6 files changed, 68 insertions, 1 deletions
diff --git a/chrome/app/policy/policy_templates.json b/chrome/app/policy/policy_templates.json index 29d0f00..b7257ce 100644 --- a/chrome/app/policy/policy_templates.json +++ b/chrome/app/policy/policy_templates.json @@ -112,7 +112,7 @@ # persistent IDs for all fields (but not for groups!) are needed. These are # specified by the 'id' keys of each policy. NEVER CHANGE EXISTING IDs, # because doing so would break the deployed wire format! -# For your editing convenience: highest ID currently used: 118 +# For your editing convenience: highest ID currently used: 120 # # Placeholders: # The following placeholder strings are automatically substituted: @@ -2282,6 +2282,32 @@ If the policy is not set, or is set to false, then record splitting will be used on SSL/TLS connections which use CBC ciphersuites.''', }, + { + 'name': 'ReportDeviceVersionInfo', + 'type': 'main', + 'supported_on': ['chrome_os:0.18-'], + 'device_only': True, + 'features': {'dynamic_refresh': True}, + 'example_value': False, + 'id': 119, + 'caption': '''Report OS and firmware version.''', + 'desc': '''Report OS and firmware version of enrolled devices. + + If this setting is set to True, enrolled devices will report the OS and firmware version periodically. If this setting is not set or set to False, version info will not be reported.''', + }, + { + 'name': 'ReportDeviceActivityTimes', + 'type': 'main', + 'supported_on': ['chrome_os:18-'], + 'device_only': True, + 'features': {'dynamic_refresh': True}, + 'example_value': False, + 'id': 120, + 'caption': '''Report device activity times''', + 'desc': '''Report device activity times. + + If this setting is set to True, enrolled devices will report time periods when a user is active on the device. If this setting is not set or set to False, device activity times will not be recorded or reported.''', + }, ], 'messages': { # Messages that are not associated to any policies. diff --git a/chrome/browser/policy/configuration_policy_handler_list.cc b/chrome/browser/policy/configuration_policy_handler_list.cc index c001837..d7287b4 100644 --- a/chrome/browser/policy/configuration_policy_handler_list.cc +++ b/chrome/browser/policy/configuration_policy_handler_list.cc @@ -296,6 +296,12 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = { { key::kChromeOsReleaseChannel, prefs::kChromeOsReleaseChannel, Value::TYPE_STRING }, + { key::kReportDeviceVersionInfo, + prefs::kReportDeviceVersionInfo, + Value::TYPE_BOOLEAN }, + { key::kReportDeviceActivityTimes, + prefs::kReportDeviceActivityTimes, + Value::TYPE_BOOLEAN }, #endif // defined(OS_CHROMEOS) }; diff --git a/chrome/browser/policy/device_policy_cache.cc b/chrome/browser/policy/device_policy_cache.cc index 1a4ea93..7424a37 100644 --- a/chrome/browser/policy/device_policy_cache.cc +++ b/chrome/browser/policy/device_policy_cache.cc @@ -368,6 +368,24 @@ void DevicePolicyCache::DecodeDevicePolicy( POLICY_SCOPE_MACHINE, Value::CreateStringValue(config)); } + + if (policy.has_device_reporting()) { + if (policy.device_reporting().has_report_version_info()) { + bool enabled = policy.device_reporting().report_version_info(); + policies->Set(key::kReportDeviceVersionInfo, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_MACHINE, + Value::CreateBooleanValue(enabled)); + } + if (policy.device_reporting().has_report_activity_times()) { + bool enabled = policy.device_reporting().report_activity_times(); + policies->Set(key::kReportDeviceActivityTimes, + POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_MACHINE, + Value::CreateBooleanValue(enabled)); + } + } + } } // namespace policy diff --git a/chrome/browser/policy/proto/chrome_device_policy.proto b/chrome/browser/policy/proto/chrome_device_policy.proto index 9664544..17a5208 100644 --- a/chrome/browser/policy/proto/chrome_device_policy.proto +++ b/chrome/browser/policy/proto/chrome_device_policy.proto @@ -85,6 +85,12 @@ message DeviceOpenNetworkConfigurationProto { optional string open_network_configuration = 1; } +// Policies to turn on portions of the device status reports. +message DeviceReportingProto { + optional bool report_version_info = 1; + optional bool report_activity_times = 2; +} + message ChromeDeviceSettingsProto { optional DevicePolicyRefreshRateProto device_policy_refresh_rate = 1; optional UserWhitelistProto user_whitelist = 2; @@ -97,4 +103,5 @@ message ChromeDeviceSettingsProto { optional MetricsEnabledProto metrics_enabled = 9; optional ReleaseChannelProto release_channel = 10; optional DeviceOpenNetworkConfigurationProto open_network_configuration = 11; + optional DeviceReportingProto device_reporting = 12; } diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index a868577..b171c53 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc @@ -1598,6 +1598,14 @@ const char kCarrierDealPromoShown[] = // auto-enrollment check has been done once and completed. It can be reset to // false if the user opts out of auto enrollment. const char kShouldAutoEnroll[] = "ShouldAutoEnroll"; + +// A boolean pref that indicates whether OS & firmware version info should be +// reported along with device policy requests. +const char kReportDeviceVersionInfo[] = "device_status.report_version_info"; + +// A boolean pref that indicates whether device activity times should be +// recorded and reported along with device policy requests. +const char kReportDeviceActivityTimes[] = "device_status.report_activity_times"; #endif // Whether there is a Flash version installed that supports clearing LSO data. diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index 1d0be21..62eba9a 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h @@ -615,6 +615,8 @@ extern const char kSignedSettingsCache[]; extern const char kHardwareKeyboardLayout[]; extern const char kCarrierDealPromoShown[]; extern const char kShouldAutoEnroll[]; +extern const char kReportDeviceVersionInfo[]; +extern const char kReportDeviceActivityTimes[]; #endif extern const char kClearPluginLSODataEnabled[]; |