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 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1535 dictionary.SetBoolean(kTagShowProxy, !network->profile_path().empty()); | 1535 dictionary.SetBoolean(kTagShowProxy, !network->profile_path().empty()); |
1536 | 1536 |
1537 // Enable static ip config for ethernet. For wifi, enable if flag is set. | 1537 // Enable static ip config for ethernet. For wifi, enable if flag is set. |
1538 bool staticIPConfig = type == flimflam::kTypeEthernet || | 1538 bool staticIPConfig = type == flimflam::kTypeEthernet || |
1539 (type == flimflam::kTypeWifi && | 1539 (type == flimflam::kTypeWifi && |
1540 CommandLine::ForCurrentProcess()->HasSwitch( | 1540 CommandLine::ForCurrentProcess()->HasSwitch( |
1541 chromeos::switches::kEnableStaticIPConfig)); | 1541 chromeos::switches::kEnableStaticIPConfig)); |
1542 dictionary.SetBoolean(kTagShowStaticIPConfig, staticIPConfig); | 1542 dictionary.SetBoolean(kTagShowStaticIPConfig, staticIPConfig); |
1543 | 1543 |
1544 dictionary.SetBoolean(kTagShowPreferred, !network->profile_path().empty()); | 1544 dictionary.SetBoolean(kTagShowPreferred, !network->profile_path().empty()); |
1545 bool preferred = network->priority() > 0; | 1545 int priority = 0; |
| 1546 shill_properties.GetIntegerWithoutPathExpansion( |
| 1547 flimflam::kPriorityProperty, &priority); |
| 1548 bool preferred = priority > 0; |
1546 SetValueDictionary(&dictionary, kTagPreferred, | 1549 SetValueDictionary(&dictionary, kTagPreferred, |
1547 new base::FundamentalValue(preferred), | 1550 new base::FundamentalValue(preferred), |
1548 property_ui_data); | 1551 property_ui_data); |
1549 | 1552 |
1550 NetworkPropertyUIData auto_connect_ui_data(onc_source); | 1553 NetworkPropertyUIData auto_connect_ui_data(onc_source); |
1551 std::string onc_path_to_auto_connect; | 1554 std::string onc_path_to_auto_connect; |
1552 if (type == flimflam::kTypeWifi) { | 1555 if (type == flimflam::kTypeWifi) { |
1553 onc_path_to_auto_connect = base::StringPrintf( | 1556 onc_path_to_auto_connect = base::StringPrintf( |
1554 "%s.%s", | 1557 "%s.%s", |
1555 onc::network_config::kWiFi, | 1558 onc::network_config::kWiFi, |
1556 onc::wifi::kAutoConnect); | 1559 onc::wifi::kAutoConnect); |
1557 } else if (type == flimflam::kTypeVPN) { | 1560 } else if (type == flimflam::kTypeVPN) { |
1558 onc_path_to_auto_connect = base::StringPrintf( | 1561 onc_path_to_auto_connect = base::StringPrintf( |
1559 "%s.%s", | 1562 "%s.%s", |
1560 onc::network_config::kVPN, | 1563 onc::network_config::kVPN, |
1561 onc::vpn::kAutoConnect); | 1564 onc::vpn::kAutoConnect); |
1562 } | 1565 } |
1563 if (!onc_path_to_auto_connect.empty()) { | 1566 if (!onc_path_to_auto_connect.empty()) { |
1564 auto_connect_ui_data.ParseOncProperty( | 1567 auto_connect_ui_data.ParseOncProperty( |
1565 onc_source, onc, onc_path_to_auto_connect); | 1568 onc_source, onc, onc_path_to_auto_connect); |
1566 } | 1569 } |
| 1570 bool auto_connect = false; |
| 1571 shill_properties.GetBooleanWithoutPathExpansion( |
| 1572 flimflam::kPriorityProperty, &auto_connect); |
1567 SetValueDictionary(&dictionary, kTagAutoConnect, | 1573 SetValueDictionary(&dictionary, kTagAutoConnect, |
1568 new base::FundamentalValue(network->auto_connect()), | 1574 new base::FundamentalValue(auto_connect), |
1569 auto_connect_ui_data); | 1575 auto_connect_ui_data); |
1570 | 1576 |
1571 PopulateConnectionDetails(network, shill_properties, &dictionary); | 1577 PopulateConnectionDetails(network, shill_properties, &dictionary); |
1572 | 1578 |
1573 // Show details dialog | 1579 // Show details dialog |
1574 web_ui()->CallJavascriptFunction(kShowDetailedInfoFunction, dictionary); | 1580 web_ui()->CallJavascriptFunction(kShowDetailedInfoFunction, dictionary); |
1575 } | 1581 } |
1576 | 1582 |
1577 namespace { | 1583 namespace { |
1578 | 1584 |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2011 cellular && cellular->support_network_scan()); | 2017 cellular && cellular->support_network_scan()); |
2012 | 2018 |
2013 dictionary->SetBoolean(kTagWimaxAvailable, | 2019 dictionary->SetBoolean(kTagWimaxAvailable, |
2014 handler->IsTechnologyAvailable(flimflam::kTypeWimax)); | 2020 handler->IsTechnologyAvailable(flimflam::kTypeWimax)); |
2015 dictionary->SetBoolean(kTagWimaxEnabled, | 2021 dictionary->SetBoolean(kTagWimaxEnabled, |
2016 handler->IsTechnologyEnabled(flimflam::kTypeWimax)); | 2022 handler->IsTechnologyEnabled(flimflam::kTypeWimax)); |
2017 } | 2023 } |
2018 | 2024 |
2019 } // namespace options | 2025 } // namespace options |
2020 } // namespace chromeos | 2026 } // namespace chromeos |
OLD | NEW |