summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'extensions')
-rw-r--r--extensions/shell/browser/shell_browser_main_parts.cc6
-rw-r--r--extensions/shell/browser/shell_network_controller_chromeos.cc7
-rw-r--r--extensions/shell/browser/shell_network_controller_chromeos.h3
-rw-r--r--extensions/shell/common/switches.cc3
-rw-r--r--extensions/shell/common/switches.h1
5 files changed, 20 insertions, 0 deletions
diff --git a/extensions/shell/browser/shell_browser_main_parts.cc b/extensions/shell/browser/shell_browser_main_parts.cc
index 5ee89cb..80deb9d 100644
--- a/extensions/shell/browser/shell_browser_main_parts.cc
+++ b/extensions/shell/browser/shell_browser_main_parts.cc
@@ -113,6 +113,12 @@ void ShellBrowserMainParts::PostMainMessageLoopStart() {
network_controller_.reset(new ShellNetworkController(
base::CommandLine::ForCurrentProcess()->GetSwitchValueNative(
switches::kAppShellPreferredNetwork)));
+
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kAppShellAllowRoaming)) {
+ network_controller_->SetCellularAllowRoaming(true);
+ }
+
#else
// Non-Chrome OS platforms are for developer convenience, so use a test IME.
ui::InitializeInputMethodForTesting();
diff --git a/extensions/shell/browser/shell_network_controller_chromeos.cc b/extensions/shell/browser/shell_network_controller_chromeos.cc
index 1a0d525..4ff45c7 100644
--- a/extensions/shell/browser/shell_network_controller_chromeos.cc
+++ b/extensions/shell/browser/shell_network_controller_chromeos.cc
@@ -10,6 +10,7 @@
#include "base/strings/stringprintf.h"
#include "base/time/time.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_callbacks.h"
#include "chromeos/network/network_state.h"
@@ -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() {
chromeos::NetworkStateHandler* state_handler =
chromeos::NetworkHandler::Get()->network_state_handler();
diff --git a/extensions/shell/browser/shell_network_controller_chromeos.h b/extensions/shell/browser/shell_network_controller_chromeos.h
index 1f36a74..4945c80 100644
--- a/extensions/shell/browser/shell_network_controller_chromeos.h
+++ b/extensions/shell/browser/shell_network_controller_chromeos.h
@@ -30,6 +30,9 @@ class ShellNetworkController : public chromeos::NetworkStateHandlerObserver {
void NetworkConnectionStateChanged(
const chromeos::NetworkState* state) override;
+ // Control whether the cellular network connection allows roaming.
+ void SetCellularAllowRoaming(bool allow_roaming);
+
private:
// State of communication with the connection manager.
enum State {
diff --git a/extensions/shell/common/switches.cc b/extensions/shell/common/switches.cc
index 446b424..fbb5783 100644
--- a/extensions/shell/common/switches.cc
+++ b/extensions/shell/common/switches.cc
@@ -7,6 +7,9 @@
namespace extensions {
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").
const char kAppShellHostWindowSize[] = "app-shell-host-window-size";
diff --git a/extensions/shell/common/switches.h b/extensions/shell/common/switches.h
index 7fe3d59..b6b3932 100644
--- a/extensions/shell/common/switches.h
+++ b/extensions/shell/common/switches.h
@@ -10,6 +10,7 @@ namespace switches {
// All switches in alphabetical order. The switches should be documented
// alongside the definition of their values in the .cc file.
+extern const char kAppShellAllowRoaming[];
extern const char kAppShellHostWindowSize[];
extern const char kAppShellInstallCrx[];
extern const char kAppShellPreferredNetwork[];