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

Side by Side Diff: chrome/browser/chromeos/policy/device_network_configuration_updater.cc

Issue 2694923005: Appropriate handling for Cellular First devices. (Closed)
Patch Set: Created 3 years, 10 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
OLDNEW
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 data_roaming_setting_subscription_ = cros_settings->AddSettingsObserver( 52 data_roaming_setting_subscription_ = cros_settings->AddSettingsObserver(
53 chromeos::kSignedDataRoamingEnabled, 53 chromeos::kSignedDataRoamingEnabled,
54 base::Bind( 54 base::Bind(
55 &DeviceNetworkConfigurationUpdater::OnDataRoamingSettingChanged, 55 &DeviceNetworkConfigurationUpdater::OnDataRoamingSettingChanged,
56 base::Unretained(this))); 56 base::Unretained(this)));
57 } 57 }
58 58
59 void DeviceNetworkConfigurationUpdater::Init() { 59 void DeviceNetworkConfigurationUpdater::Init() {
60 NetworkConfigurationUpdater::Init(); 60 NetworkConfigurationUpdater::Init();
61 61
62 // TODO(xdai): kAllowDataRoamingByDefault is only used by Rialto devices for 62 // If this is a Cellular First device, then cellular data roaming
63 // development/testing purpose. After Rialto migrates to use KIOSK app mode, 63 // should be allowed by default.
64 // remove this part of logic. 64 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
65 const policy::BrowserPolicyConnectorChromeOS* connector = 65 chromeos::switches::kCellularFirst)) {
66 g_browser_process->platform_part()->browser_policy_connector_chromeos();
67 if (!connector->IsEnterpriseManaged() &&
68 base::CommandLine::ForCurrentProcess()->HasSwitch(
69 chromeos::switches::kAllowDataRoamingByDefault)) {
70 network_device_handler_->SetCellularAllowRoaming(true); 66 network_device_handler_->SetCellularAllowRoaming(true);
71 } else { 67 } else {
72 // Apply the roaming setting initially. 68 // Apply the roaming setting initially.
73 OnDataRoamingSettingChanged(); 69 OnDataRoamingSettingChanged();
74 } 70 }
75 71
76 // Set up MAC address randomization if we are not enterprise managed. 72 // Set up MAC address randomization if we are not enterprise managed.
73 const policy::BrowserPolicyConnectorChromeOS* connector =
74 g_browser_process->platform_part()->browser_policy_connector_chromeos();
77 network_device_handler_->SetMACAddressRandomizationEnabled( 75 network_device_handler_->SetMACAddressRandomizationEnabled(
78 !connector->IsEnterpriseManaged()); 76 !connector->IsEnterpriseManaged());
79 } 77 }
80 78
81 void DeviceNetworkConfigurationUpdater::ImportCertificates( 79 void DeviceNetworkConfigurationUpdater::ImportCertificates(
82 const base::ListValue& certificates_onc) { 80 const base::ListValue& certificates_onc) {
83 // Importing CA and server certs from device policy is not allowed, while 81 // Importing CA and server certs from device policy is not allowed, while
84 // importing client is not yet supported (as a system-wide PKCS#11 token to 82 // importing client is not yet supported (as a system-wide PKCS#11 token to
85 // which they should be imported does not exists at the time). 83 // which they should be imported does not exists at the time).
86 } 84 }
(...skipping 30 matching lines...) Expand all
117 } else { 115 } else {
118 DCHECK_EQ(trusted_status, 116 DCHECK_EQ(trusted_status,
119 chromeos::CrosSettingsProvider::PERMANENTLY_UNTRUSTED); 117 chromeos::CrosSettingsProvider::PERMANENTLY_UNTRUSTED);
120 // Roaming is disabled as we can't determine the correct setting. 118 // Roaming is disabled as we can't determine the correct setting.
121 } 119 }
122 120
123 network_device_handler_->SetCellularAllowRoaming(data_roaming_setting); 121 network_device_handler_->SetCellularAllowRoaming(data_roaming_setting);
124 } 122 }
125 123
126 } // namespace policy 124 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698