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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc

Issue 11829015: Add the ability to activate for carriers that need to be directly activated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/internet_options_handler.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/options/chromeos/internet_options_handler.h" 5 #include "chrome/browser/ui/webui/options/chromeos/internet_options_handler.h"
6 6
7 #include <ctype.h> 7 #include <ctype.h>
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 // Google public name servers (DNS). 105 // Google public name servers (DNS).
106 const char kGoogleNameServers[] = "8.8.4.4,8.8.8.8"; 106 const char kGoogleNameServers[] = "8.8.4.4,8.8.8.8";
107 107
108 // Functions we call in JavaScript. 108 // Functions we call in JavaScript.
109 const char kRefreshNetworkDataFunction[] = 109 const char kRefreshNetworkDataFunction[] =
110 "options.network.NetworkList.refreshNetworkData"; 110 "options.network.NetworkList.refreshNetworkData";
111 const char kSetDefaultNetworkIconsFunction[] = 111 const char kSetDefaultNetworkIconsFunction[] =
112 "options.network.NetworkList.setDefaultNetworkIcons"; 112 "options.network.NetworkList.setDefaultNetworkIcons";
113 const char kShowDetailedInfoFunction[] = 113 const char kShowDetailedInfoFunction[] =
114 "options.internet.DetailsInternetPage.showDetailedInfo"; 114 "options.internet.DetailsInternetPage.showDetailedInfo";
115 const char kUpdateConnectionDataFunction[] =
116 "options.internet.DetailsInternetPage.updateConnectionData";
115 const char kUpdateCarrierFunction[] = 117 const char kUpdateCarrierFunction[] =
116 "options.internet.DetailsInternetPage.updateCarrier"; 118 "options.internet.DetailsInternetPage.updateCarrier";
117 const char kUpdateSecurityTabFunction[] = 119 const char kUpdateSecurityTabFunction[] =
118 "options.internet.DetailsInternetPage.updateSecurityTab"; 120 "options.internet.DetailsInternetPage.updateSecurityTab";
119 121
120 // These are used to register message handlers with JavaScript. 122 // These are used to register message handlers with JavaScript.
121 const char kBuyDataPlanMessage[] = "buyDataPlan"; 123 const char kBuyDataPlanMessage[] = "buyDataPlan";
122 const char kChangePinMessage[] = "changePin"; 124 const char kChangePinMessage[] = "changePin";
123 const char kDisableCellularMessage[] = "disableCellular"; 125 const char kDisableCellularMessage[] = "disableCellular";
124 const char kDisableWifiMessage[] = "disableWifi"; 126 const char kDisableWifiMessage[] = "disableWifi";
(...skipping 29 matching lines...) Expand all
154 const char kTagCellularBusy[] = "cellularBusy"; 156 const char kTagCellularBusy[] = "cellularBusy";
155 const char kTagCellularEnabled[] = "cellularEnabled"; 157 const char kTagCellularEnabled[] = "cellularEnabled";
156 const char kTagCellularSupportsScan[] = "cellularSupportsScan"; 158 const char kTagCellularSupportsScan[] = "cellularSupportsScan";
157 const char kTagConnect[] = "connect"; 159 const char kTagConnect[] = "connect";
158 const char kTagConnected[] = "connected"; 160 const char kTagConnected[] = "connected";
159 const char kTagConnecting[] = "connecting"; 161 const char kTagConnecting[] = "connecting";
160 const char kTagConnectionState[] = "connectionState"; 162 const char kTagConnectionState[] = "connectionState";
161 const char kTagControlledBy[] = "controlledBy"; 163 const char kTagControlledBy[] = "controlledBy";
162 const char kTagDataRemaining[] = "dataRemaining"; 164 const char kTagDataRemaining[] = "dataRemaining";
163 const char kTagDeviceConnected[] = "deviceConnected"; 165 const char kTagDeviceConnected[] = "deviceConnected";
166 const char kTagDisableConnectButton[] = "disableConnectButton";
164 const char kTagDisconnect[] = "disconnect"; 167 const char kTagDisconnect[] = "disconnect";
165 const char kTagEncryption[] = "encryption"; 168 const char kTagEncryption[] = "encryption";
166 const char kTagErrorState[] = "errorState"; 169 const char kTagErrorState[] = "errorState";
167 const char kTagEsn[] = "esn"; 170 const char kTagEsn[] = "esn";
168 const char kTagFirmwareRevision[] = "firmwareRevision"; 171 const char kTagFirmwareRevision[] = "firmwareRevision";
169 const char kTagForget[] = "forget"; 172 const char kTagForget[] = "forget";
170 const char kTagFrequency[] = "frequency"; 173 const char kTagFrequency[] = "frequency";
171 const char kTagGsm[] = "gsm"; 174 const char kTagGsm[] = "gsm";
172 const char kTagHardwareAddress[] = "hardwareAddress"; 175 const char kTagHardwareAddress[] = "hardwareAddress";
173 const char kTagHardwareRevision[] = "hardwareRevision"; 176 const char kTagHardwareRevision[] = "hardwareRevision";
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 hostname_ui_data.ParseOncProperty( 521 hostname_ui_data.ParseOncProperty(
519 vpn->ui_data(), &onc, 522 vpn->ui_data(), &onc,
520 base::StringPrintf("%s.%s", 523 base::StringPrintf("%s.%s",
521 chromeos::onc::kVPN, 524 chromeos::onc::kVPN,
522 chromeos::onc::vpn::kHost)); 525 chromeos::onc::vpn::kHost));
523 SetValueDictionary(dictionary, kTagServerHostname, 526 SetValueDictionary(dictionary, kTagServerHostname,
524 new base::StringValue(vpn->server_hostname()), 527 new base::StringValue(vpn->server_hostname()),
525 hostname_ui_data); 528 hostname_ui_data);
526 } 529 }
527 530
531 // Activate the cellular device pointed to by the service path.
532 void Activate(std::string service_path) {
533 chromeos::Network* network = NULL;
534 if (!service_path.empty()) {
535 network = chromeos::CrosLibrary::Get()->GetNetworkLibrary()->
536 FindNetworkByPath(service_path);
537 } else {
538 NOTREACHED();
539 return;
540 }
541 if (network->type() != chromeos::TYPE_CELLULAR)
542 return;
543 static_cast<chromeos::CellularNetwork*>(network)->StartActivation();
544 }
545
546 // Check if the current cellular device can be activated by directly calling
547 // it's activate function instead of going through the activation process.
548 // Note: Currently Sprint is the only carrier that uses this.
549 bool UseDirectActivation() {
550 const chromeos::NetworkDevice* device =
551 chromeos::CrosLibrary::Get()->GetNetworkLibrary()->FindCellularDevice();
552 return device && (device->carrier() == shill::kCarrierSprint);
553 }
554
528 // Given a list of supported carrier's by the device, return the index of 555 // Given a list of supported carrier's by the device, return the index of
529 // the carrier the device is currently using. 556 // the carrier the device is currently using.
530 int FindCurrentCarrierIndex(const base::ListValue* carriers, 557 int FindCurrentCarrierIndex(const base::ListValue* carriers,
531 const chromeos::NetworkDevice* device) { 558 const chromeos::NetworkDevice* device) {
532 DCHECK(carriers); 559 DCHECK(carriers);
533 DCHECK(device); 560 DCHECK(device);
534 561
535 bool gsm = (device->technology_family() == chromeos::TECHNOLOGY_FAMILY_GSM); 562 bool gsm = (device->technology_family() == chromeos::TECHNOLOGY_FAMILY_GSM);
536 int index = 0; 563 int index = 0;
537 for (base::ListValue::const_iterator it = carriers->begin(); 564 for (base::ListValue::const_iterator it = carriers->begin();
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 return web_ui_util::GetBitmapDataUrl(image_rep.sk_bitmap()); 1011 return web_ui_util::GetBitmapDataUrl(image_rep.sk_bitmap());
985 } 1012 }
986 1013
987 void InternetOptionsHandler::RefreshNetworkData() { 1014 void InternetOptionsHandler::RefreshNetworkData() {
988 DictionaryValue dictionary; 1015 DictionaryValue dictionary;
989 FillNetworkInfo(&dictionary); 1016 FillNetworkInfo(&dictionary);
990 web_ui()->CallJavascriptFunction( 1017 web_ui()->CallJavascriptFunction(
991 kRefreshNetworkDataFunction, dictionary); 1018 kRefreshNetworkDataFunction, dictionary);
992 } 1019 }
993 1020
1021 void InternetOptionsHandler::UpdateConnectionData(
1022 const chromeos::Network* network) {
1023 DictionaryValue dictionary;
1024 PopulateConnectionDetails(network, &dictionary);
1025 web_ui()->CallJavascriptFunction(
1026 kUpdateConnectionDataFunction, dictionary);
1027 }
1028
994 void InternetOptionsHandler::UpdateCarrier(bool success) { 1029 void InternetOptionsHandler::UpdateCarrier(bool success) {
995 base::FundamentalValue success_value(success); 1030 base::FundamentalValue success_value(success);
996 web_ui()->CallJavascriptFunction(kUpdateCarrierFunction, success_value); 1031 web_ui()->CallJavascriptFunction(kUpdateCarrierFunction, success_value);
997 } 1032 }
998 1033
999 void InternetOptionsHandler::OnNetworkManagerChanged( 1034 void InternetOptionsHandler::OnNetworkManagerChanged(
1000 chromeos::NetworkLibrary* cros) { 1035 chromeos::NetworkLibrary* cros) {
1001 if (!web_ui()) 1036 if (!web_ui())
1002 return; 1037 return;
1003 MonitorNetworks(); 1038 MonitorNetworks();
1004 RefreshNetworkData(); 1039 RefreshNetworkData();
1005 } 1040 }
1006 1041
1007 void InternetOptionsHandler::OnNetworkChanged( 1042 void InternetOptionsHandler::OnNetworkChanged(
1008 chromeos::NetworkLibrary* cros, 1043 chromeos::NetworkLibrary* cros,
1009 const chromeos::Network* network) { 1044 const chromeos::Network* network) {
1010 if (web_ui()) 1045 if (web_ui()) {
1011 RefreshNetworkData(); 1046 RefreshNetworkData();
1047 UpdateConnectionData(network);
1048 }
1012 } 1049 }
1013 1050
1014 // Monitor wireless networks for changes. It is only necessary 1051 // Monitor wireless networks for changes. It is only necessary
1015 // to set up individual observers for the cellular networks 1052 // to set up individual observers for the cellular networks
1016 // (if any) and for the connected Wi-Fi network (if any). The 1053 // (if any) and for the connected Wi-Fi network (if any). The
1017 // only change we are interested in for Wi-Fi networks is signal 1054 // only change we are interested in for Wi-Fi networks is signal
1018 // strength. For non-connected Wi-Fi networks, all information is 1055 // strength. For non-connected Wi-Fi networks, all information is
1019 // reported via scan results, which trigger network manager 1056 // reported via scan results, which trigger network manager
1020 // updates. Only the connected Wi-Fi network has changes reported 1057 // updates. Only the connected Wi-Fi network has changes reported
1021 // via service property updates. 1058 // via service property updates.
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
1275 // then just go with some defaults. 1312 // then just go with some defaults.
1276 dictionary.SetBoolean(kIpConfigAutoConfig, false); 1313 dictionary.SetBoolean(kIpConfigAutoConfig, false);
1277 dictionary.Set(kDictionarySavedIp, new DictionaryValue); 1314 dictionary.Set(kDictionarySavedIp, new DictionaryValue);
1278 SetValueDictionary(&dictionary, kDictionaryStaticIp, new DictionaryValue, 1315 SetValueDictionary(&dictionary, kDictionaryStaticIp, new DictionaryValue,
1279 property_ui_data); 1316 property_ui_data);
1280 } 1317 }
1281 1318
1282 chromeos::ConnectionType type = network->type(); 1319 chromeos::ConnectionType type = network->type();
1283 dictionary.SetInteger(kTagType, type); 1320 dictionary.SetInteger(kTagType, type);
1284 dictionary.SetString(kTagServicePath, network->service_path()); 1321 dictionary.SetString(kTagServicePath, network->service_path());
1285 dictionary.SetBoolean(kTagConnecting, network->connecting());
1286 dictionary.SetBoolean(kTagConnected, network->connected());
1287 dictionary.SetString(kTagConnectionState, network->GetStateString());
1288 dictionary.SetString(kTagNetworkName, network->name());
1289 dictionary.SetString(kTagNameServerType, name_server_type); 1322 dictionary.SetString(kTagNameServerType, name_server_type);
1290 dictionary.SetString(kTagNameServersGoogle, kGoogleNameServers); 1323 dictionary.SetString(kTagNameServersGoogle, kGoogleNameServers);
1291 1324
1292 // Only show proxy for remembered networks. 1325 // Only show proxy for remembered networks.
1293 chromeos::NetworkProfileType network_profile = network->profile_type(); 1326 chromeos::NetworkProfileType network_profile = network->profile_type();
1294 dictionary.SetBoolean(kTagShowProxy, 1327 dictionary.SetBoolean(kTagShowProxy,
1295 network_profile != chromeos::PROFILE_NONE); 1328 network_profile != chromeos::PROFILE_NONE);
1296 1329
1297 // Enable static ip config for ethernet. For wifi, enable if flag is set. 1330 // Enable static ip config for ethernet. For wifi, enable if flag is set.
1298 bool staticIPConfig = type == chromeos::TYPE_ETHERNET || 1331 bool staticIPConfig = type == chromeos::TYPE_ETHERNET ||
(...skipping 13 matching lines...) Expand all
1312 auto_connect_ui_data.ParseOncProperty( 1345 auto_connect_ui_data.ParseOncProperty(
1313 ui_data, onc, 1346 ui_data, onc,
1314 base::StringPrintf("%s.%s", 1347 base::StringPrintf("%s.%s",
1315 chromeos::onc::kWiFi, 1348 chromeos::onc::kWiFi,
1316 chromeos::onc::wifi::kAutoConnect)); 1349 chromeos::onc::wifi::kAutoConnect));
1317 } 1350 }
1318 SetValueDictionary(&dictionary, kTagAutoConnect, 1351 SetValueDictionary(&dictionary, kTagAutoConnect,
1319 new base::FundamentalValue(network->auto_connect()), 1352 new base::FundamentalValue(network->auto_connect()),
1320 auto_connect_ui_data); 1353 auto_connect_ui_data);
1321 1354
1322 if (type == chromeos::TYPE_WIFI) { 1355 PopulateConnectionDetails(network, &dictionary);
1323 dictionary.SetBoolean(kTagDeviceConnected, cros_->wifi_connected());
1324 PopulateWifiDetails(static_cast<const chromeos::WifiNetwork*>(network),
1325 &dictionary);
1326 } else if (type == chromeos::TYPE_WIMAX) {
1327 dictionary.SetBoolean(kTagDeviceConnected, cros_->wimax_connected());
1328 PopulateWimaxDetails(static_cast<const chromeos::WimaxNetwork*>(network),
1329 &dictionary);
1330 } else if (type == chromeos::TYPE_CELLULAR) {
1331 dictionary.SetBoolean(kTagDeviceConnected, cros_->cellular_connected());
1332 PopulateCellularDetails(
1333 static_cast<const chromeos::CellularNetwork*>(network),
1334 &dictionary);
1335 } else if (type == chromeos::TYPE_VPN) {
1336 dictionary.SetBoolean(kTagDeviceConnected,
1337 cros_->virtual_network_connected());
1338 PopulateVPNDetails(static_cast<const chromeos::VirtualNetwork*>(network),
1339 *onc,
1340 &dictionary);
1341 } else if (type == chromeos::TYPE_ETHERNET) {
1342 dictionary.SetBoolean(kTagDeviceConnected, cros_->ethernet_connected());
1343 }
1344
1345 web_ui()->CallJavascriptFunction( 1356 web_ui()->CallJavascriptFunction(
1346 kShowDetailedInfoFunction, dictionary); 1357 kShowDetailedInfoFunction, dictionary);
1347 } 1358 }
1348 1359
1360 void InternetOptionsHandler::PopulateConnectionDetails(
1361 const chromeos::Network* network, DictionaryValue* dictionary) {
1362 chromeos::ConnectionType type = network->type();
1363 dictionary->SetBoolean(kTagConnecting, network->connecting());
1364 dictionary->SetBoolean(kTagConnected, network->connected());
1365 dictionary->SetString(kTagConnectionState, network->GetStateString());
1366 dictionary->SetString(kTagNetworkName, network->name());
1367
1368 if (type == chromeos::TYPE_WIFI) {
1369 dictionary->SetBoolean(kTagDeviceConnected, cros_->wifi_connected());
1370 PopulateWifiDetails(static_cast<const chromeos::WifiNetwork*>(network),
1371 dictionary);
1372 } else if (type == chromeos::TYPE_WIMAX) {
1373 dictionary->SetBoolean(kTagDeviceConnected, cros_->wimax_connected());
1374 PopulateWimaxDetails(static_cast<const chromeos::WimaxNetwork*>(network),
1375 dictionary);
1376 } else if (type == chromeos::TYPE_CELLULAR) {
1377 dictionary->SetBoolean(kTagDeviceConnected, cros_->cellular_connected());
1378 PopulateCellularDetails(
1379 static_cast<const chromeos::CellularNetwork*>(network),
1380 dictionary);
1381 } else if (type == chromeos::TYPE_VPN) {
1382 dictionary->SetBoolean(kTagDeviceConnected,
1383 cros_->virtual_network_connected());
1384 const base::DictionaryValue* onc =
1385 cros_->FindOncForNetwork(network->unique_id());
1386 PopulateVPNDetails(static_cast<const chromeos::VirtualNetwork*>(network),
1387 *onc,
1388 dictionary);
1389 } else if (type == chromeos::TYPE_ETHERNET) {
1390 dictionary->SetBoolean(kTagDeviceConnected, cros_->ethernet_connected());
1391 }
1392 }
1393
1349 void InternetOptionsHandler::PopulateWifiDetails( 1394 void InternetOptionsHandler::PopulateWifiDetails(
1350 const chromeos::WifiNetwork* wifi, 1395 const chromeos::WifiNetwork* wifi,
1351 DictionaryValue* dictionary) { 1396 DictionaryValue* dictionary) {
1352 dictionary->SetString(kTagSsid, wifi->name()); 1397 dictionary->SetString(kTagSsid, wifi->name());
1353 bool remembered = (wifi->profile_type() != chromeos::PROFILE_NONE); 1398 bool remembered = (wifi->profile_type() != chromeos::PROFILE_NONE);
1354 dictionary->SetBoolean(kTagRemembered, remembered); 1399 dictionary->SetBoolean(kTagRemembered, remembered);
1355 bool shared = wifi->profile_type() == chromeos::PROFILE_SHARED; 1400 bool shared = wifi->profile_type() == chromeos::PROFILE_SHARED;
1356 dictionary->SetBoolean(kTagShared, shared); 1401 dictionary->SetBoolean(kTagShared, shared);
1357 dictionary->SetString(kTagEncryption, wifi->GetEncryptionString()); 1402 dictionary->SetString(kTagEncryption, wifi->GetEncryptionString());
1358 dictionary->SetString(kTagBssid, wifi->bssid()); 1403 dictionary->SetString(kTagBssid, wifi->bssid());
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
1468 FindCurrentCarrierIndex(supported_carriers, 1513 FindCurrentCarrierIndex(supported_carriers,
1469 device)); 1514 device));
1470 } else { 1515 } else {
1471 // In case of any error, set the current carrier tag to -1 indicating 1516 // In case of any error, set the current carrier tag to -1 indicating
1472 // to the JS code to fallback to a single carrier. 1517 // to the JS code to fallback to a single carrier.
1473 dictionary->SetInteger(kTagCurrentCarrierIndex, -1); 1518 dictionary->SetInteger(kTagCurrentCarrierIndex, -1);
1474 } 1519 }
1475 } 1520 }
1476 } 1521 }
1477 1522
1478 SetActivationButtonVisibility(cellular, 1523 SetCellularButtonsVisibility(cellular,
1479 dictionary, 1524 dictionary,
1480 cros_->GetCellularHomeCarrierId()); 1525 cros_->GetCellularHomeCarrierId());
1481 } 1526 }
1482 1527
1483 void InternetOptionsHandler::SetActivationButtonVisibility( 1528 void InternetOptionsHandler::SetCellularButtonsVisibility(
1484 const chromeos::CellularNetwork* cellular, 1529 const chromeos::CellularNetwork* cellular,
1485 DictionaryValue* dictionary, 1530 DictionaryValue* dictionary,
1486 const std::string& carrier_id) { 1531 const std::string& carrier_id) {
1532 dictionary->SetBoolean(
1533 kTagDisableConnectButton,
1534 cellular->activation_state() == chromeos::ACTIVATION_STATE_ACTIVATING ||
1535 cellular->connecting());
1536
1487 if (cellular->activation_state() != chromeos::ACTIVATION_STATE_ACTIVATING && 1537 if (cellular->activation_state() != chromeos::ACTIVATION_STATE_ACTIVATING &&
1488 cellular->activation_state() != chromeos::ACTIVATION_STATE_ACTIVATED) { 1538 cellular->activation_state() != chromeos::ACTIVATION_STATE_ACTIVATED) {
1489 dictionary->SetBoolean(kTagShowActivateButton, true); 1539 dictionary->SetBoolean(kTagShowActivateButton, true);
1490 } else { 1540 } else {
1491 const chromeos::MobileConfig::Carrier* carrier = 1541 const chromeos::MobileConfig::Carrier* carrier =
1492 chromeos::MobileConfig::GetInstance()->GetCarrier(carrier_id); 1542 chromeos::MobileConfig::GetInstance()->GetCarrier(carrier_id);
1493 if (carrier && carrier->show_portal_button()) { 1543 if (carrier && carrier->show_portal_button()) {
1494 // This will trigger BuyDataPlanCallback() so that 1544 // This will trigger BuyDataPlanCallback() so that
1495 // chrome://mobilesetup/ will open carrier specific portal. 1545 // chrome://mobilesetup/ will open carrier specific portal.
1496 dictionary->SetBoolean(kTagShowViewAccountButton, true); 1546 dictionary->SetBoolean(kTagShowViewAccountButton, true);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1555 if (command == kTagOptions) { 1605 if (command == kTagOptions) {
1556 cros_->RequestNetworkServiceProperties( 1606 cros_->RequestNetworkServiceProperties(
1557 service_path, 1607 service_path,
1558 base::Bind(&InternetOptionsHandler::PopulateDictionaryDetailsCallback, 1608 base::Bind(&InternetOptionsHandler::PopulateDictionaryDetailsCallback,
1559 weak_factory_.GetWeakPtr())); 1609 weak_factory_.GetWeakPtr()));
1560 } else if (command == kTagConnect) { 1610 } else if (command == kTagConnect) {
1561 ConnectToNetwork(network); 1611 ConnectToNetwork(network);
1562 } else if (command == kTagDisconnect && type != chromeos::TYPE_ETHERNET) { 1612 } else if (command == kTagDisconnect && type != chromeos::TYPE_ETHERNET) {
1563 cros_->DisconnectFromNetwork(network); 1613 cros_->DisconnectFromNetwork(network);
1564 } else if (command == kTagActivate && type == chromeos::TYPE_CELLULAR) { 1614 } else if (command == kTagActivate && type == chromeos::TYPE_CELLULAR) {
1565 ash::Shell::GetInstance()->delegate()->OpenMobileSetup( 1615 if (!UseDirectActivation()) {
1566 network->service_path()); 1616 ash::Shell::GetInstance()->delegate()->OpenMobileSetup(
1617 network->service_path());
1618 } else {
1619 Activate(service_path);
1620 // Update network properties after we start activation. The Activate
1621 // call is a blocking call, which blocks on finishing the "start" of
1622 // the activation, hence when we query for network properties after
1623 // this call is done, we will have the "activating" activation state.
1624 UpdateConnectionData(network);
1625 }
1567 } else { 1626 } else {
1568 VLOG(1) << "Unknown command: " << command; 1627 VLOG(1) << "Unknown command: " << command;
1569 NOTREACHED(); 1628 NOTREACHED();
1570 } 1629 }
1571 } 1630 }
1572 1631
1573 void InternetOptionsHandler::ToggleAirplaneModeCallback(const ListValue* args) { 1632 void InternetOptionsHandler::ToggleAirplaneModeCallback(const ListValue* args) {
1574 // TODO(kevers): The use of 'offline_mode' is not quite correct. Update once 1633 // TODO(kevers): The use of 'offline_mode' is not quite correct. Update once
1575 // we have proper back-end support. 1634 // we have proper back-end support.
1576 cros_->EnableOfflineMode(!cros_->offline_mode()); 1635 cros_->EnableOfflineMode(!cros_->offline_mode());
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1760 1819
1761 dictionary->SetBoolean(kTagWimaxEnabled, cros_->wimax_enabled()); 1820 dictionary->SetBoolean(kTagWimaxEnabled, cros_->wimax_enabled());
1762 dictionary->SetBoolean(kTagWimaxAvailable, cros_->wimax_available()); 1821 dictionary->SetBoolean(kTagWimaxAvailable, cros_->wimax_available());
1763 dictionary->SetBoolean(kTagWimaxBusy, cros_->wimax_busy()); 1822 dictionary->SetBoolean(kTagWimaxBusy, cros_->wimax_busy());
1764 // TODO(kevers): The use of 'offline_mode' is not quite correct. Update once 1823 // TODO(kevers): The use of 'offline_mode' is not quite correct. Update once
1765 // we have proper back-end support. 1824 // we have proper back-end support.
1766 dictionary->SetBoolean(kTagAirplaneMode, cros_->offline_mode()); 1825 dictionary->SetBoolean(kTagAirplaneMode, cros_->offline_mode());
1767 } 1826 }
1768 1827
1769 } // namespace options 1828 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/internet_options_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698