diff options
-rw-r--r-- | chrome/browser/chromeos/policy/device_network_configuration_updater.cc | 19 | ||||
-rw-r--r-- | chromeos/chromeos_switches.cc | 7 | ||||
-rw-r--r-- | chromeos/chromeos_switches.h | 5 |
3 files changed, 27 insertions, 4 deletions
diff --git a/chrome/browser/chromeos/policy/device_network_configuration_updater.cc b/chrome/browser/chromeos/policy/device_network_configuration_updater.cc index 6acddad..d2eedd7 100644 --- a/chrome/browser/chromeos/policy/device_network_configuration_updater.cc +++ b/chrome/browser/chromeos/policy/device_network_configuration_updater.cc @@ -6,7 +6,11 @@ #include "base/bind.h" #include "base/bind_helpers.h" +#include "base/command_line.h" +#include "chrome/browser/browser_process.h" +#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" #include "chrome/browser/chromeos/settings/cros_settings.h" +#include "chromeos/chromeos_switches.h" #include "chromeos/network/managed_network_configuration_handler.h" #include "chromeos/network/network_device_handler.h" #include "chromeos/settings/cros_settings_names.h" @@ -56,8 +60,19 @@ DeviceNetworkConfigurationUpdater::DeviceNetworkConfigurationUpdater( void DeviceNetworkConfigurationUpdater::Init() { NetworkConfigurationUpdater::Init(); - // Apply the roaming setting initially. - OnDataRoamingSettingChanged(); + // TODO(xdai): kAllowDataRoamingByDefault is only used by Rialto devices for + // development/testing purpose. After Rialto migrates to use KIOSK app mode, + // remove this part of logic. + const policy::BrowserPolicyConnectorChromeOS* connector = + g_browser_process->platform_part()->browser_policy_connector_chromeos(); + if (!connector->IsEnterpriseManaged() && + base::CommandLine::ForCurrentProcess()->HasSwitch( + chromeos::switches::kAllowDataRoamingByDefault)) { + network_device_handler_->SetCellularAllowRoaming(true); + } else { + // Apply the roaming setting initially. + OnDataRoamingSettingChanged(); + } } void DeviceNetworkConfigurationUpdater::ImportCertificates( diff --git a/chromeos/chromeos_switches.cc b/chromeos/chromeos_switches.cc index d3abe54..987984b 100644 --- a/chromeos/chromeos_switches.cc +++ b/chromeos/chromeos_switches.cc @@ -12,6 +12,13 @@ namespace chromeos { namespace switches { + +// If this flag is set, enable data roaming in the cellular network by default +// upon system start if it's an unmanaged device. This flag is used by Rialto +// device to obtain device policy during OOBE since the Rialto device has no +// display and and only connects over cell. +const char kAllowDataRoamingByDefault[] = "allow-data-roaming-by-default"; + // If this flag is passed, failed policy fetches will not cause profile // initialization to fail. This is useful for tests because it means that // tests don't have to mock out the policy infrastructure. diff --git a/chromeos/chromeos_switches.h b/chromeos/chromeos_switches.h index d1d9d54..fa61ba5 100644 --- a/chromeos/chromeos_switches.h +++ b/chromeos/chromeos_switches.h @@ -13,14 +13,15 @@ namespace switches { // Switches that are used in src/chromeos must go here. // Other switches that apply just to chromeos code should go here also (along -// with any code that is specific to the chromeos system). ChromeOS specific UI -// should be in src/ash. +// with any code that is specific to the chromeos system). Chrome OS specific +// UI should be in src/ash. // Note: If you add a switch, consider if it needs to be copied to a subsequent // command line if the process executes a new copy of itself. (For example, // see chromeos::LoginUtil::GetOffTheRecordCommandLine().) // Please keep alphabetized. +CHROMEOS_EXPORT extern const char kAllowDataRoamingByDefault[]; CHROMEOS_EXPORT extern const char kAllowFailedPolicyFetchForTest[]; CHROMEOS_EXPORT extern const char kAllowRAInDevMode[]; CHROMEOS_EXPORT extern const char kAppOemManifestFile[]; |