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 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1348 network_profile == chromeos::PROFILE_USER); | 1348 network_profile == chromeos::PROFILE_USER); |
1349 SetValueDictionary(&dictionary, kTagPreferred, | 1349 SetValueDictionary(&dictionary, kTagPreferred, |
1350 new base::FundamentalValue(network->preferred()), | 1350 new base::FundamentalValue(network->preferred()), |
1351 property_ui_data); | 1351 property_ui_data); |
1352 | 1352 |
1353 chromeos::NetworkPropertyUIData auto_connect_ui_data(ui_data); | 1353 chromeos::NetworkPropertyUIData auto_connect_ui_data(ui_data); |
1354 if (type == chromeos::TYPE_WIFI) { | 1354 if (type == chromeos::TYPE_WIFI) { |
1355 auto_connect_ui_data.ParseOncProperty( | 1355 auto_connect_ui_data.ParseOncProperty( |
1356 ui_data, onc, | 1356 ui_data, onc, |
1357 base::StringPrintf("%s.%s", | 1357 base::StringPrintf("%s.%s", |
1358 chromeos::onc::kWiFi, | 1358 chromeos::onc::network_config::kWiFi, |
1359 chromeos::onc::wifi::kAutoConnect)); | 1359 chromeos::onc::wifi::kAutoConnect)); |
1360 } | 1360 } |
1361 SetValueDictionary(&dictionary, kTagAutoConnect, | 1361 SetValueDictionary(&dictionary, kTagAutoConnect, |
1362 new base::FundamentalValue(network->auto_connect()), | 1362 new base::FundamentalValue(network->auto_connect()), |
1363 auto_connect_ui_data); | 1363 auto_connect_ui_data); |
1364 | 1364 |
1365 PopulateConnectionDetails(network, &dictionary); | 1365 PopulateConnectionDetails(network, &dictionary); |
1366 web_ui()->CallJavascriptFunction( | 1366 web_ui()->CallJavascriptFunction( |
1367 kShowDetailedInfoFunction, dictionary); | 1367 kShowDetailedInfoFunction, dictionary); |
1368 } | 1368 } |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1829 | 1829 |
1830 dictionary->SetBoolean(kTagWimaxEnabled, cros_->wimax_enabled()); | 1830 dictionary->SetBoolean(kTagWimaxEnabled, cros_->wimax_enabled()); |
1831 dictionary->SetBoolean(kTagWimaxAvailable, cros_->wimax_available()); | 1831 dictionary->SetBoolean(kTagWimaxAvailable, cros_->wimax_available()); |
1832 dictionary->SetBoolean(kTagWimaxBusy, cros_->wimax_busy()); | 1832 dictionary->SetBoolean(kTagWimaxBusy, cros_->wimax_busy()); |
1833 // TODO(kevers): The use of 'offline_mode' is not quite correct. Update once | 1833 // TODO(kevers): The use of 'offline_mode' is not quite correct. Update once |
1834 // we have proper back-end support. | 1834 // we have proper back-end support. |
1835 dictionary->SetBoolean(kTagAirplaneMode, cros_->offline_mode()); | 1835 dictionary->SetBoolean(kTagAirplaneMode, cros_->offline_mode()); |
1836 } | 1836 } |
1837 | 1837 |
1838 } // namespace options | 1838 } // namespace options |
OLD | NEW |