| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/policy/device_network_configuration_updater.h" | 5 #include "chrome/browser/chromeos/policy/device_network_configuration_updater.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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 const policy::BrowserPolicyConnectorChromeOS* connector = | 65 const policy::BrowserPolicyConnectorChromeOS* connector = |
| 66 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 66 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
| 67 if (!connector->IsEnterpriseManaged() && | 67 if (!connector->IsEnterpriseManaged() && |
| 68 base::CommandLine::ForCurrentProcess()->HasSwitch( | 68 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 69 chromeos::switches::kAllowDataRoamingByDefault)) { | 69 chromeos::switches::kAllowDataRoamingByDefault)) { |
| 70 network_device_handler_->SetCellularAllowRoaming(true); | 70 network_device_handler_->SetCellularAllowRoaming(true); |
| 71 } else { | 71 } else { |
| 72 // Apply the roaming setting initially. | 72 // Apply the roaming setting initially. |
| 73 OnDataRoamingSettingChanged(); | 73 OnDataRoamingSettingChanged(); |
| 74 } | 74 } |
| 75 |
| 76 // Set up MAC address randomization if we are not enterprise managed. |
| 77 network_device_handler_->SetMACAddressRandomizationEnabled( |
| 78 !connector->IsEnterpriseManaged()); |
| 75 } | 79 } |
| 76 | 80 |
| 77 void DeviceNetworkConfigurationUpdater::ImportCertificates( | 81 void DeviceNetworkConfigurationUpdater::ImportCertificates( |
| 78 const base::ListValue& certificates_onc) { | 82 const base::ListValue& certificates_onc) { |
| 79 // Importing CA and server certs from device policy is not allowed, while | 83 // Importing CA and server certs from device policy is not allowed, while |
| 80 // importing client is not yet supported (as a system-wide PKCS#11 token to | 84 // importing client is not yet supported (as a system-wide PKCS#11 token to |
| 81 // which they should be imported does not exists at the time). | 85 // which they should be imported does not exists at the time). |
| 82 } | 86 } |
| 83 | 87 |
| 84 void DeviceNetworkConfigurationUpdater::ApplyNetworkPolicy( | 88 void DeviceNetworkConfigurationUpdater::ApplyNetworkPolicy( |
| (...skipping 28 matching lines...) Expand all Loading... |
| 113 } else { | 117 } else { |
| 114 DCHECK_EQ(trusted_status, | 118 DCHECK_EQ(trusted_status, |
| 115 chromeos::CrosSettingsProvider::PERMANENTLY_UNTRUSTED); | 119 chromeos::CrosSettingsProvider::PERMANENTLY_UNTRUSTED); |
| 116 // Roaming is disabled as we can't determine the correct setting. | 120 // Roaming is disabled as we can't determine the correct setting. |
| 117 } | 121 } |
| 118 | 122 |
| 119 network_device_handler_->SetCellularAllowRoaming(data_roaming_setting); | 123 network_device_handler_->SetCellularAllowRoaming(data_roaming_setting); |
| 120 } | 124 } |
| 121 | 125 |
| 122 } // namespace policy | 126 } // namespace policy |
| OLD | NEW |