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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 dictionary->SetString(kTagService_name, vpn->name()); | 514 dictionary->SetString(kTagService_name, vpn->name()); |
515 bool remembered = (vpn->profile_type() != chromeos::PROFILE_NONE); | 515 bool remembered = (vpn->profile_type() != chromeos::PROFILE_NONE); |
516 dictionary->SetBoolean(kTagRemembered, remembered); | 516 dictionary->SetBoolean(kTagRemembered, remembered); |
517 dictionary->SetString(kTagProvider_type, vpn->GetProviderTypeString()); | 517 dictionary->SetString(kTagProvider_type, vpn->GetProviderTypeString()); |
518 dictionary->SetString(kTagUsername, vpn->username()); | 518 dictionary->SetString(kTagUsername, vpn->username()); |
519 | 519 |
520 chromeos::NetworkPropertyUIData hostname_ui_data; | 520 chromeos::NetworkPropertyUIData hostname_ui_data; |
521 hostname_ui_data.ParseOncProperty( | 521 hostname_ui_data.ParseOncProperty( |
522 vpn->ui_data(), &onc, | 522 vpn->ui_data(), &onc, |
523 base::StringPrintf("%s.%s", | 523 base::StringPrintf("%s.%s", |
524 chromeos::onc::kVPN, | 524 chromeos::onc::network_config::kVPN, |
525 chromeos::onc::vpn::kHost)); | 525 chromeos::onc::vpn::kHost)); |
526 SetValueDictionary(dictionary, kTagServerHostname, | 526 SetValueDictionary(dictionary, kTagServerHostname, |
527 new base::StringValue(vpn->server_hostname()), | 527 new base::StringValue(vpn->server_hostname()), |
528 hostname_ui_data); | 528 hostname_ui_data); |
529 } | 529 } |
530 | 530 |
531 // Activate the cellular device pointed to by the service path. | 531 // Activate the cellular device pointed to by the service path. |
532 void Activate(std::string service_path) { | 532 void Activate(std::string service_path) { |
533 chromeos::Network* network = NULL; | 533 chromeos::Network* network = NULL; |
534 if (!service_path.empty()) { | 534 if (!service_path.empty()) { |
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1338 network_profile == chromeos::PROFILE_USER); | 1338 network_profile == chromeos::PROFILE_USER); |
1339 SetValueDictionary(&dictionary, kTagPreferred, | 1339 SetValueDictionary(&dictionary, kTagPreferred, |
1340 new base::FundamentalValue(network->preferred()), | 1340 new base::FundamentalValue(network->preferred()), |
1341 property_ui_data); | 1341 property_ui_data); |
1342 | 1342 |
1343 chromeos::NetworkPropertyUIData auto_connect_ui_data(ui_data); | 1343 chromeos::NetworkPropertyUIData auto_connect_ui_data(ui_data); |
1344 if (type == chromeos::TYPE_WIFI) { | 1344 if (type == chromeos::TYPE_WIFI) { |
1345 auto_connect_ui_data.ParseOncProperty( | 1345 auto_connect_ui_data.ParseOncProperty( |
1346 ui_data, onc, | 1346 ui_data, onc, |
1347 base::StringPrintf("%s.%s", | 1347 base::StringPrintf("%s.%s", |
1348 chromeos::onc::kWiFi, | 1348 chromeos::onc::network_config::kWiFi, |
1349 chromeos::onc::wifi::kAutoConnect)); | 1349 chromeos::onc::wifi::kAutoConnect)); |
1350 } | 1350 } |
1351 SetValueDictionary(&dictionary, kTagAutoConnect, | 1351 SetValueDictionary(&dictionary, kTagAutoConnect, |
1352 new base::FundamentalValue(network->auto_connect()), | 1352 new base::FundamentalValue(network->auto_connect()), |
1353 auto_connect_ui_data); | 1353 auto_connect_ui_data); |
1354 | 1354 |
1355 PopulateConnectionDetails(network, &dictionary); | 1355 PopulateConnectionDetails(network, &dictionary); |
1356 web_ui()->CallJavascriptFunction( | 1356 web_ui()->CallJavascriptFunction( |
1357 kShowDetailedInfoFunction, dictionary); | 1357 kShowDetailedInfoFunction, dictionary); |
1358 } | 1358 } |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1819 | 1819 |
1820 dictionary->SetBoolean(kTagWimaxEnabled, cros_->wimax_enabled()); | 1820 dictionary->SetBoolean(kTagWimaxEnabled, cros_->wimax_enabled()); |
1821 dictionary->SetBoolean(kTagWimaxAvailable, cros_->wimax_available()); | 1821 dictionary->SetBoolean(kTagWimaxAvailable, cros_->wimax_available()); |
1822 dictionary->SetBoolean(kTagWimaxBusy, cros_->wimax_busy()); | 1822 dictionary->SetBoolean(kTagWimaxBusy, cros_->wimax_busy()); |
1823 // 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 |
1824 // we have proper back-end support. | 1824 // we have proper back-end support. |
1825 dictionary->SetBoolean(kTagAirplaneMode, cros_->offline_mode()); | 1825 dictionary->SetBoolean(kTagAirplaneMode, cros_->offline_mode()); |
1826 } | 1826 } |
1827 | 1827 |
1828 } // namespace options | 1828 } // namespace options |
OLD | NEW |