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

Unified Diff: ash/system/chromeos/network/network_connect.cc

Issue 22950007: Insufficient information on activation details should be handled correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nit, added some other changes that fell into this CL. Created 7 years, 4 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 | « no previous file | chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/chromeos/network/network_connect.cc
diff --git a/ash/system/chromeos/network/network_connect.cc b/ash/system/chromeos/network/network_connect.cc
index 3aca16222230d9c0b4020f18da533b92f69b7ed5..688c9108704330e78d767de2cec543af1f644ca4 100644
--- a/ash/system/chromeos/network/network_connect.cc
+++ b/ash/system/chromeos/network/network_connect.cc
@@ -254,25 +254,27 @@ void ConnectToNetwork(const std::string& service_path,
void ActivateCellular(const std::string& service_path) {
NET_LOG_USER("ActivateCellular", service_path);
+ const NetworkState* cellular =
+ NetworkHandler::Get()->network_state_handler()->
+ GetNetworkState(service_path);
+ if (!cellular || cellular->type() != flimflam::kTypeCellular) {
+ NET_LOG_ERROR("ActivateCellular with no Service", service_path);
+ return;
+ }
const DeviceState* cellular_device =
NetworkHandler::Get()->network_state_handler()->
- GetDeviceStateByType(flimflam::kTypeCellular);
+ GetDeviceState(cellular->device_path());
if (!cellular_device) {
NET_LOG_ERROR("ActivateCellular with no Device", service_path);
return;
}
if (!IsDirectActivatedCarrier(cellular_device->carrier())) {
// For non direct activation, show the mobile setup dialog which can be
- // used to activate the network.
- ash::Shell::GetInstance()->system_tray_delegate()->ShowMobileSetup(
- service_path);
- return;
- }
- const NetworkState* cellular =
- NetworkHandler::Get()->network_state_handler()->
- GetNetworkState(service_path);
- if (!cellular || cellular->type() != flimflam::kTypeCellular) {
- NET_LOG_ERROR("ActivateCellular with no Service", service_path);
+ // used to activate the network. Only show the dialog, if an account
+ // management URL is available.
+ if (!cellular->payment_url().empty())
+ ash::Shell::GetInstance()->system_tray_delegate()->ShowMobileSetup(
+ service_path);
stevenjb 2013/08/14 23:19:23 nit: {} around multi-line statement
armansito 2013/08/15 00:35:36 Oh, this is not a multi-line statement. We show mo
return;
}
if (cellular->activation_state() == flimflam::kActivationStateActivated) {
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698