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

Side by Side 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: Add test. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chromeos/settings/device_settings_provider.h" 5 #include "chrome/browser/chromeos/settings/device_settings_provider.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 kDeviceAttestationEnabled, 55 kDeviceAttestationEnabled,
56 kDeviceOwner, 56 kDeviceOwner,
57 kIdleLogoutTimeout, 57 kIdleLogoutTimeout,
58 kIdleLogoutWarningDuration, 58 kIdleLogoutWarningDuration,
59 kPolicyMissingMitigationMode, 59 kPolicyMissingMitigationMode,
60 kReleaseChannel, 60 kReleaseChannel,
61 kReleaseChannelDelegated, 61 kReleaseChannelDelegated,
62 kReportDeviceActivityTimes, 62 kReportDeviceActivityTimes,
63 kReportDeviceBootMode, 63 kReportDeviceBootMode,
64 kReportDeviceLocation, 64 kReportDeviceLocation,
65 kReportDeviceNetworkInterfaces,
65 kReportDeviceVersionInfo, 66 kReportDeviceVersionInfo,
66 kScreenSaverExtensionId, 67 kScreenSaverExtensionId,
67 kScreenSaverTimeout, 68 kScreenSaverTimeout,
68 kSignedDataRoamingEnabled, 69 kSignedDataRoamingEnabled,
69 kStartUpFlags, 70 kStartUpFlags,
70 kStartUpUrls, 71 kStartUpUrls,
71 kStatsReportingPref, 72 kStatsReportingPref,
72 kSystemTimezonePolicy, 73 kSystemTimezonePolicy,
73 kUpdateDisabled, 74 kUpdateDisabled,
74 kVariationsRestrictParameter, 75 kVariationsRestrictParameter,
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 // kAppPack 372 // kAppPack
372 // kDeviceAttestationEnabled 373 // kDeviceAttestationEnabled
373 // kDeviceOwner 374 // kDeviceOwner
374 // kIdleLogoutTimeout 375 // kIdleLogoutTimeout
375 // kIdleLogoutWarningDuration 376 // kIdleLogoutWarningDuration
376 // kReleaseChannelDelegated 377 // kReleaseChannelDelegated
377 // kReportDeviceActivityTimes 378 // kReportDeviceActivityTimes
378 // kReportDeviceBootMode 379 // kReportDeviceBootMode
379 // kReportDeviceLocation 380 // kReportDeviceLocation
380 // kReportDeviceVersionInfo 381 // kReportDeviceVersionInfo
382 // kReportDeviceNetworkInterfaces
381 // kScreenSaverExtensionId 383 // kScreenSaverExtensionId
382 // kScreenSaverTimeout 384 // kScreenSaverTimeout
383 // kStartUpUrls 385 // kStartUpUrls
384 // kSystemTimezonePolicy 386 // kSystemTimezonePolicy
385 // kVariationsRestrictParameter 387 // kVariationsRestrictParameter
386 388
387 LOG(FATAL) << "Device setting " << prop << " is read-only."; 389 LOG(FATAL) << "Device setting " << prop << " is read-only.";
388 } 390 }
389 391
390 em::PolicyData data; 392 em::PolicyData data;
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 for (RepeatedField<int>::const_iterator i = allowed_connection_types.begin(), 628 for (RepeatedField<int>::const_iterator i = allowed_connection_types.begin(),
627 e = allowed_connection_types.end(); i != e; ++i) { 629 e = allowed_connection_types.end(); i != e; ++i) {
628 list->Append(new base::FundamentalValue(*i)); 630 list->Append(new base::FundamentalValue(*i));
629 } 631 }
630 new_values_cache->SetValue(kAllowedConnectionTypesForUpdate, list); 632 new_values_cache->SetValue(kAllowedConnectionTypesForUpdate, list);
631 } 633 }
632 634
633 void DeviceSettingsProvider::DecodeReportingPolicies( 635 void DeviceSettingsProvider::DecodeReportingPolicies(
634 const em::ChromeDeviceSettingsProto& policy, 636 const em::ChromeDeviceSettingsProto& policy,
635 PrefValueMap* new_values_cache) const { 637 PrefValueMap* new_values_cache) const {
636 if (policy.has_device_reporting()) { 638 if (policy.has_device_reporting()) {
pneubeck (no reviews) 2013/07/04 15:51:48 nit: could be negated and early return.
Mattias Nissler (ping if slow) 2013/07/11 17:41:46 That would make it inconsistent with the pattern a
637 if (policy.device_reporting().has_report_version_info()) { 639 if (policy.device_reporting().has_report_version_info()) {
pneubeck (no reviews) 2013/07/04 15:51:48 nit: and policy.device_reporting() could be assign
Mattias Nissler (ping if slow) 2013/07/11 17:41:46 Done. Kept the formatting for consistency (the new
638 new_values_cache->SetBoolean( 640 new_values_cache->SetBoolean(
639 kReportDeviceVersionInfo, 641 kReportDeviceVersionInfo,
640 policy.device_reporting().report_version_info()); 642 policy.device_reporting().report_version_info());
641 } 643 }
642 if (policy.device_reporting().has_report_activity_times()) { 644 if (policy.device_reporting().has_report_activity_times()) {
643 new_values_cache->SetBoolean( 645 new_values_cache->SetBoolean(
644 kReportDeviceActivityTimes, 646 kReportDeviceActivityTimes,
645 policy.device_reporting().report_activity_times()); 647 policy.device_reporting().report_activity_times());
646 } 648 }
647 if (policy.device_reporting().has_report_boot_mode()) { 649 if (policy.device_reporting().has_report_boot_mode()) {
648 new_values_cache->SetBoolean( 650 new_values_cache->SetBoolean(
649 kReportDeviceBootMode, 651 kReportDeviceBootMode,
650 policy.device_reporting().report_boot_mode()); 652 policy.device_reporting().report_boot_mode());
651 } 653 }
652 // Device location reporting needs to pass privacy review before it can be 654 // Device location reporting needs to pass privacy review before it can be
653 // enabled. crosbug.com/24681 655 // enabled. crosbug.com/24681
654 // if (policy.device_reporting().has_report_location()) { 656 // if (policy.device_reporting().has_report_location()) {
Greg Spencer (Chromium) 2013/07/08 21:44:18 nit: I know you didn't add it here, but commented
Mattias Nissler (ping if slow) 2013/07/11 17:41:46 Removed.
655 // new_values_cache->SetBoolean( 657 // new_values_cache->SetBoolean(
656 // kReportDeviceLocation, 658 // kReportDeviceLocation,
657 // policy.device_reporting().report_location()); 659 // policy.device_reporting().report_location());
658 // } 660 // }
661 if (policy.device_reporting().has_report_network_interfaces()) {
662 new_values_cache->SetBoolean(
663 kReportDeviceNetworkInterfaces,
664 policy.device_reporting().report_network_interfaces());
665 }
659 } 666 }
660 } 667 }
661 668
662 void DeviceSettingsProvider::DecodeGenericPolicies( 669 void DeviceSettingsProvider::DecodeGenericPolicies(
663 const em::ChromeDeviceSettingsProto& policy, 670 const em::ChromeDeviceSettingsProto& policy,
664 PrefValueMap* new_values_cache) const { 671 PrefValueMap* new_values_cache) const {
665 if (policy.has_metrics_enabled()) { 672 if (policy.has_metrics_enabled()) {
666 new_values_cache->SetBoolean(kStatsReportingPref, 673 new_values_cache->SetBoolean(kStatsReportingPref,
667 policy.metrics_enabled().metrics_enabled()); 674 policy.metrics_enabled().metrics_enabled());
668 } else { 675 } else {
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
952 void DeviceSettingsProvider::AttemptMigration() { 959 void DeviceSettingsProvider::AttemptMigration() {
953 if (device_settings_service_->HasPrivateOwnerKey()) { 960 if (device_settings_service_->HasPrivateOwnerKey()) {
954 PrefValueMap::const_iterator i; 961 PrefValueMap::const_iterator i;
955 for (i = migration_values_.begin(); i != migration_values_.end(); ++i) 962 for (i = migration_values_.begin(); i != migration_values_.end(); ++i)
956 DoSet(i->first, *i->second); 963 DoSet(i->first, *i->second);
957 migration_values_.Clear(); 964 migration_values_.Clear();
958 } 965 }
959 } 966 }
960 967
961 } // namespace chromeos 968 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698