OLD | NEW |
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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 dictionary->SetString(kTagProvider_type, vpn->GetProviderTypeString()); | 513 dictionary->SetString(kTagProvider_type, vpn->GetProviderTypeString()); |
514 dictionary->SetString(kTagUsername, vpn->username()); | 514 dictionary->SetString(kTagUsername, vpn->username()); |
515 | 515 |
516 chromeos::NetworkPropertyUIData hostname_ui_data; | 516 chromeos::NetworkPropertyUIData hostname_ui_data; |
517 hostname_ui_data.ParseOncProperty( | 517 hostname_ui_data.ParseOncProperty( |
518 vpn->ui_data(), &onc, | 518 vpn->ui_data(), &onc, |
519 base::StringPrintf("%s.%s", | 519 base::StringPrintf("%s.%s", |
520 chromeos::onc::kVPN, | 520 chromeos::onc::kVPN, |
521 chromeos::onc::vpn::kHost)); | 521 chromeos::onc::vpn::kHost)); |
522 SetValueDictionary(dictionary, kTagServerHostname, | 522 SetValueDictionary(dictionary, kTagServerHostname, |
523 Value::CreateStringValue(vpn->server_hostname()), | 523 new base::StringValue(vpn->server_hostname()), |
524 hostname_ui_data); | 524 hostname_ui_data); |
525 } | 525 } |
526 | 526 |
527 // Given a list of supported carrier's by the device, return the index of | 527 // Given a list of supported carrier's by the device, return the index of |
528 // the carrier the device is currently using. | 528 // the carrier the device is currently using. |
529 int FindCurrentCarrierIndex(const base::ListValue* carriers, | 529 int FindCurrentCarrierIndex(const base::ListValue* carriers, |
530 const chromeos::NetworkDevice* device) { | 530 const chromeos::NetworkDevice* device) { |
531 DCHECK(carriers); | 531 DCHECK(carriers); |
532 DCHECK(device); | 532 DCHECK(device); |
533 | 533 |
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1304 // Enable static ip config for ethernet. For wifi, enable if flag is set. | 1304 // Enable static ip config for ethernet. For wifi, enable if flag is set. |
1305 bool staticIPConfig = type == chromeos::TYPE_ETHERNET || | 1305 bool staticIPConfig = type == chromeos::TYPE_ETHERNET || |
1306 (type == chromeos::TYPE_WIFI && | 1306 (type == chromeos::TYPE_WIFI && |
1307 CommandLine::ForCurrentProcess()->HasSwitch( | 1307 CommandLine::ForCurrentProcess()->HasSwitch( |
1308 switches::kEnableStaticIPConfig)); | 1308 switches::kEnableStaticIPConfig)); |
1309 dictionary.SetBoolean(kTagShowStaticIPConfig, staticIPConfig); | 1309 dictionary.SetBoolean(kTagShowStaticIPConfig, staticIPConfig); |
1310 | 1310 |
1311 dictionary.SetBoolean(kTagShowPreferred, | 1311 dictionary.SetBoolean(kTagShowPreferred, |
1312 network_profile == chromeos::PROFILE_USER); | 1312 network_profile == chromeos::PROFILE_USER); |
1313 SetValueDictionary(&dictionary, kTagPreferred, | 1313 SetValueDictionary(&dictionary, kTagPreferred, |
1314 Value::CreateBooleanValue(network->preferred()), | 1314 new base::FundamentalValue(network->preferred()), |
1315 property_ui_data); | 1315 property_ui_data); |
1316 | 1316 |
1317 chromeos::NetworkPropertyUIData auto_connect_ui_data(ui_data); | 1317 chromeos::NetworkPropertyUIData auto_connect_ui_data(ui_data); |
1318 if (type == chromeos::TYPE_WIFI) { | 1318 if (type == chromeos::TYPE_WIFI) { |
1319 auto_connect_ui_data.ParseOncProperty( | 1319 auto_connect_ui_data.ParseOncProperty( |
1320 ui_data, onc, | 1320 ui_data, onc, |
1321 base::StringPrintf("%s.%s", | 1321 base::StringPrintf("%s.%s", |
1322 chromeos::onc::kWiFi, | 1322 chromeos::onc::kWiFi, |
1323 chromeos::onc::wifi::kAutoConnect)); | 1323 chromeos::onc::wifi::kAutoConnect)); |
1324 } | 1324 } |
1325 SetValueDictionary(&dictionary, kTagAutoConnect, | 1325 SetValueDictionary(&dictionary, kTagAutoConnect, |
1326 Value::CreateBooleanValue(network->auto_connect()), | 1326 new base::FundamentalValue(network->auto_connect()), |
1327 auto_connect_ui_data); | 1327 auto_connect_ui_data); |
1328 | 1328 |
1329 if (type == chromeos::TYPE_WIFI) { | 1329 if (type == chromeos::TYPE_WIFI) { |
1330 dictionary.SetBoolean(kTagDeviceConnected, cros_->wifi_connected()); | 1330 dictionary.SetBoolean(kTagDeviceConnected, cros_->wifi_connected()); |
1331 PopulateWifiDetails(static_cast<const chromeos::WifiNetwork*>(network), | 1331 PopulateWifiDetails(static_cast<const chromeos::WifiNetwork*>(network), |
1332 &dictionary); | 1332 &dictionary); |
1333 } else if (type == chromeos::TYPE_WIMAX) { | 1333 } else if (type == chromeos::TYPE_WIMAX) { |
1334 dictionary.SetBoolean(kTagDeviceConnected, cros_->wimax_connected()); | 1334 dictionary.SetBoolean(kTagDeviceConnected, cros_->wimax_connected()); |
1335 PopulateWimaxDetails(static_cast<const chromeos::WimaxNetwork*>(network), | 1335 PopulateWimaxDetails(static_cast<const chromeos::WimaxNetwork*>(network), |
1336 &dictionary); | 1336 &dictionary); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1437 dictionary->SetString(kTagMeid, device->meid()); | 1437 dictionary->SetString(kTagMeid, device->meid()); |
1438 dictionary->SetString(kTagImei, device->imei()); | 1438 dictionary->SetString(kTagImei, device->imei()); |
1439 dictionary->SetString(kTagMdn, device->mdn()); | 1439 dictionary->SetString(kTagMdn, device->mdn()); |
1440 dictionary->SetString(kTagImsi, device->imsi()); | 1440 dictionary->SetString(kTagImsi, device->imsi()); |
1441 dictionary->SetString(kTagEsn, device->esn()); | 1441 dictionary->SetString(kTagEsn, device->esn()); |
1442 dictionary->SetString(kTagMin, device->min()); | 1442 dictionary->SetString(kTagMin, device->min()); |
1443 dictionary->SetBoolean(kTagGsm, | 1443 dictionary->SetBoolean(kTagGsm, |
1444 device->technology_family() == chromeos::TECHNOLOGY_FAMILY_GSM); | 1444 device->technology_family() == chromeos::TECHNOLOGY_FAMILY_GSM); |
1445 SetValueDictionary( | 1445 SetValueDictionary( |
1446 dictionary, kTagSimCardLockEnabled, | 1446 dictionary, kTagSimCardLockEnabled, |
1447 Value::CreateBooleanValue( | 1447 new base::FundamentalValue( |
1448 device->sim_pin_required() == chromeos::SIM_PIN_REQUIRED), | 1448 device->sim_pin_required() == chromeos::SIM_PIN_REQUIRED), |
1449 cellular_property_ui_data); | 1449 cellular_property_ui_data); |
1450 | 1450 |
1451 chromeos::MobileConfig* config = chromeos::MobileConfig::GetInstance(); | 1451 chromeos::MobileConfig* config = chromeos::MobileConfig::GetInstance(); |
1452 if (config->IsReady()) { | 1452 if (config->IsReady()) { |
1453 const std::string& carrier_id = cros_->GetCellularHomeCarrierId(); | 1453 const std::string& carrier_id = cros_->GetCellularHomeCarrierId(); |
1454 const chromeos::MobileConfig::Carrier* carrier = | 1454 const chromeos::MobileConfig::Carrier* carrier = |
1455 config->GetCarrier(carrier_id); | 1455 config->GetCarrier(carrier_id); |
1456 if (carrier && !carrier->top_up_url().empty()) | 1456 if (carrier && !carrier->top_up_url().empty()) |
1457 dictionary->SetString(kTagCarrierUrl, carrier->top_up_url()); | 1457 dictionary->SetString(kTagCarrierUrl, carrier->top_up_url()); |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1764 | 1764 |
1765 dictionary->SetBoolean(kTagWimaxEnabled, cros_->wimax_enabled()); | 1765 dictionary->SetBoolean(kTagWimaxEnabled, cros_->wimax_enabled()); |
1766 dictionary->SetBoolean(kTagWimaxAvailable, cros_->wimax_available()); | 1766 dictionary->SetBoolean(kTagWimaxAvailable, cros_->wimax_available()); |
1767 dictionary->SetBoolean(kTagWimaxBusy, cros_->wimax_busy()); | 1767 dictionary->SetBoolean(kTagWimaxBusy, cros_->wimax_busy()); |
1768 // TODO(kevers): The use of 'offline_mode' is not quite correct. Update once | 1768 // TODO(kevers): The use of 'offline_mode' is not quite correct. Update once |
1769 // we have proper back-end support. | 1769 // we have proper back-end support. |
1770 dictionary->SetBoolean(kTagAirplaneMode, cros_->offline_mode()); | 1770 dictionary->SetBoolean(kTagAirplaneMode, cros_->offline_mode()); |
1771 } | 1771 } |
1772 | 1772 |
1773 } // namespace options | 1773 } // namespace options |
OLD | NEW |