Commit 97ecc6e5 authored by jsimmons's avatar jsimmons Committed by Commit bot

Add a flag to app_shell that allows roaming on cellular networks

BUG=chrome-os-partner:37102

Review URL: https://codereview.chromium.org/1085973002

Cr-Commit-Position: refs/heads/master@{#325525}
parent b7b72aab
...@@ -113,6 +113,12 @@ void ShellBrowserMainParts::PostMainMessageLoopStart() { ...@@ -113,6 +113,12 @@ void ShellBrowserMainParts::PostMainMessageLoopStart() {
network_controller_.reset(new ShellNetworkController( network_controller_.reset(new ShellNetworkController(
base::CommandLine::ForCurrentProcess()->GetSwitchValueNative( base::CommandLine::ForCurrentProcess()->GetSwitchValueNative(
switches::kAppShellPreferredNetwork))); switches::kAppShellPreferredNetwork)));
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kAppShellAllowRoaming)) {
network_controller_->SetCellularAllowRoaming(true);
}
#else #else
// Non-Chrome OS platforms are for developer convenience, so use a test IME. // Non-Chrome OS platforms are for developer convenience, so use a test IME.
ui::InitializeInputMethodForTesting(); ui::InitializeInputMethodForTesting();
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_connection_handler.h"
#include "chromeos/network/network_device_handler.h"
#include "chromeos/network/network_handler.h" #include "chromeos/network/network_handler.h"
#include "chromeos/network/network_handler_callbacks.h" #include "chromeos/network/network_handler_callbacks.h"
#include "chromeos/network/network_state.h" #include "chromeos/network/network_state.h"
...@@ -102,6 +103,12 @@ void ShellNetworkController::NetworkConnectionStateChanged( ...@@ -102,6 +103,12 @@ void ShellNetworkController::NetworkConnectionStateChanged(
} }
} }
void ShellNetworkController::SetCellularAllowRoaming(bool allow_roaming) {
chromeos::NetworkDeviceHandler* device_handler =
chromeos::NetworkHandler::Get()->network_device_handler();
device_handler->SetCellularAllowRoaming(allow_roaming);
}
const chromeos::NetworkState* ShellNetworkController::GetActiveWiFiNetwork() { const chromeos::NetworkState* ShellNetworkController::GetActiveWiFiNetwork() {
chromeos::NetworkStateHandler* state_handler = chromeos::NetworkStateHandler* state_handler =
chromeos::NetworkHandler::Get()->network_state_handler(); chromeos::NetworkHandler::Get()->network_state_handler();
......
...@@ -30,6 +30,9 @@ class ShellNetworkController : public chromeos::NetworkStateHandlerObserver { ...@@ -30,6 +30,9 @@ class ShellNetworkController : public chromeos::NetworkStateHandlerObserver {
void NetworkConnectionStateChanged( void NetworkConnectionStateChanged(
const chromeos::NetworkState* state) override; const chromeos::NetworkState* state) override;
// Control whether the cellular network connection allows roaming.
void SetCellularAllowRoaming(bool allow_roaming);
private: private:
// State of communication with the connection manager. // State of communication with the connection manager.
enum State { enum State {
......
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
namespace extensions { namespace extensions {
namespace switches { namespace switches {
// Allow roaming in the cellular network.
const char kAppShellAllowRoaming[] = "app-shell-allow-roaming";
// Size for the host window to create (i.e. "800x600"). // Size for the host window to create (i.e. "800x600").
const char kAppShellHostWindowSize[] = "app-shell-host-window-size"; const char kAppShellHostWindowSize[] = "app-shell-host-window-size";
......
...@@ -10,6 +10,7 @@ namespace switches { ...@@ -10,6 +10,7 @@ namespace switches {
// All switches in alphabetical order. The switches should be documented // All switches in alphabetical order. The switches should be documented
// alongside the definition of their values in the .cc file. // alongside the definition of their values in the .cc file.
extern const char kAppShellAllowRoaming[];
extern const char kAppShellHostWindowSize[]; extern const char kAppShellHostWindowSize[];
extern const char kAppShellInstallCrx[]; extern const char kAppShellInstallCrx[];
extern const char kAppShellPreferredNetwork[]; extern const char kAppShellPreferredNetwork[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment