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

Unified Diff: chrome/browser/ui/webui/options2/chromeos/internet_options_handler2.cc

Issue 10407069: Fixed enable/disable handling for WiMAX. Removed Cellular section when not available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/options2/chromeos/internet_options_handler2.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options2/chromeos/internet_options_handler2.cc
diff --git a/chrome/browser/ui/webui/options2/chromeos/internet_options_handler2.cc b/chrome/browser/ui/webui/options2/chromeos/internet_options_handler2.cc
index 3644f68aa075b3359d53851bfa4996a0e816cd19..60755e40e74b50a6b3d562b07e3afe39508187cb 100644
--- a/chrome/browser/ui/webui/options2/chromeos/internet_options_handler2.cc
+++ b/chrome/browser/ui/webui/options2/chromeos/internet_options_handler2.cc
@@ -476,10 +476,16 @@ void InternetOptionsHandler::RegisterMessages() {
base::Bind(&InternetOptionsHandler::DisableWifiCallback,
base::Unretained(this)));
web_ui()->RegisterMessageCallback("enableCellular",
- base::Bind(&InternetOptionsHandler::EnableMobileCallback,
+ base::Bind(&InternetOptionsHandler::EnableCellularCallback,
base::Unretained(this)));
web_ui()->RegisterMessageCallback("disableCellular",
- base::Bind(&InternetOptionsHandler::DisableMobileCallback,
+ base::Bind(&InternetOptionsHandler::DisableCellularCallback,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback("enableWimax",
+ base::Bind(&InternetOptionsHandler::EnableWimaxCallback,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback("disableWimax",
+ base::Bind(&InternetOptionsHandler::DisableWimaxCallback,
base::Unretained(this)));
web_ui()->RegisterMessageCallback("buyDataPlan",
base::Bind(&InternetOptionsHandler::BuyDataPlanCallback,
@@ -509,12 +515,12 @@ void InternetOptionsHandler::DisableWifiCallback(const ListValue* args) {
cros_->EnableWifiNetworkDevice(false);
}
-void InternetOptionsHandler::EnableMobileCallback(const ListValue* args) {
+void InternetOptionsHandler::EnableCellularCallback(const ListValue* args) {
// TODO(nkostylev): Code duplication, see NetworkMenu::ToggleCellular().
const chromeos::NetworkDevice* mobile = cros_->FindMobileDevice();
if (!mobile) {
LOG(ERROR) << "Didn't find mobile device, it should have been available.";
- cros_->EnableMobileNetworkDevice(true);
+ cros_->EnableCellularNetworkDevice(true);
} else if (!mobile->is_sim_locked()) {
if (mobile->is_sim_absent()) {
std::string setup_url;
@@ -531,7 +537,7 @@ void InternetOptionsHandler::EnableMobileCallback(const ListValue* args) {
// TODO(nkostylev): Show generic error message. http://crosbug.com/15444
}
} else {
- cros_->EnableMobileNetworkDevice(true);
+ cros_->EnableCellularNetworkDevice(true);
}
} else {
chromeos::SimDialogDelegate::ShowDialog(GetNativeWindow(),
@@ -539,8 +545,16 @@ void InternetOptionsHandler::EnableMobileCallback(const ListValue* args) {
}
}
-void InternetOptionsHandler::DisableMobileCallback(const ListValue* args) {
- cros_->EnableMobileNetworkDevice(false);
+void InternetOptionsHandler::DisableCellularCallback(const ListValue* args) {
+ cros_->EnableCellularNetworkDevice(false);
+}
+
+void InternetOptionsHandler::EnableWimaxCallback(const ListValue* args) {
+ cros_->EnableWimaxNetworkDevice(true);
+}
+
+void InternetOptionsHandler::DisableWimaxCallback(const ListValue* args) {
+ cros_->EnableWimaxNetworkDevice(false);
}
void InternetOptionsHandler::ShowMorePlanInfoCallback(const ListValue* args) {
@@ -1403,9 +1417,12 @@ void InternetOptionsHandler::FillNetworkInfo(DictionaryValue* dictionary) {
dictionary->SetBoolean("wifiAvailable", cros_->wifi_available());
dictionary->SetBoolean("wifiBusy", cros_->wifi_busy());
dictionary->SetBoolean("wifiEnabled", cros_->wifi_enabled());
- dictionary->SetBoolean("cellularAvailable", cros_->mobile_available());
- dictionary->SetBoolean("cellularBusy", cros_->mobile_busy());
- dictionary->SetBoolean("cellularEnabled", cros_->mobile_enabled());
+ dictionary->SetBoolean("cellularAvailable", cros_->cellular_available());
+ dictionary->SetBoolean("cellularBusy", cros_->cellular_busy());
+ dictionary->SetBoolean("cellularEnabled", cros_->cellular_enabled());
+ dictionary->SetBoolean("wimaxEnabled", cros_->wimax_enabled());
+ dictionary->SetBoolean("wimaxAvailable", cros_->wimax_available());
+ dictionary->SetBoolean("wimaxBusy", cros_->wimax_busy());
// TODO(kevers): The use of 'offline_mode' is not quite correct. Update once
// we have proper back-end support.
dictionary->SetBoolean("airplaneMode", cros_->offline_mode());
« no previous file with comments | « chrome/browser/ui/webui/options2/chromeos/internet_options_handler2.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698