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 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1553 dictionary.SetBoolean(kTagShowProxy, !network->profile_path().empty()); | 1553 dictionary.SetBoolean(kTagShowProxy, !network->profile_path().empty()); |
1554 | 1554 |
1555 // Enable static ip config for ethernet. For wifi, enable if flag is set. | 1555 // Enable static ip config for ethernet. For wifi, enable if flag is set. |
1556 bool staticIPConfig = type == flimflam::kTypeEthernet || | 1556 bool staticIPConfig = type == flimflam::kTypeEthernet || |
1557 (type == flimflam::kTypeWifi && | 1557 (type == flimflam::kTypeWifi && |
1558 CommandLine::ForCurrentProcess()->HasSwitch( | 1558 CommandLine::ForCurrentProcess()->HasSwitch( |
1559 chromeos::switches::kEnableStaticIPConfig)); | 1559 chromeos::switches::kEnableStaticIPConfig)); |
1560 dictionary.SetBoolean(kTagShowStaticIPConfig, staticIPConfig); | 1560 dictionary.SetBoolean(kTagShowStaticIPConfig, staticIPConfig); |
1561 | 1561 |
1562 dictionary.SetBoolean(kTagShowPreferred, !network->profile_path().empty()); | 1562 dictionary.SetBoolean(kTagShowPreferred, !network->profile_path().empty()); |
1563 bool preferred = network->priority() > 0; | 1563 int priority = 0; |
| 1564 shill_properties.GetIntegerWithoutPathExpansion( |
| 1565 flimflam::kPriorityProperty, &priority); |
| 1566 bool preferred = priority > 0; |
1564 SetValueDictionary(&dictionary, kTagPreferred, | 1567 SetValueDictionary(&dictionary, kTagPreferred, |
1565 new base::FundamentalValue(preferred), | 1568 new base::FundamentalValue(preferred), |
1566 property_ui_data); | 1569 property_ui_data); |
1567 | 1570 |
1568 NetworkPropertyUIData auto_connect_ui_data(onc_source); | 1571 NetworkPropertyUIData auto_connect_ui_data(onc_source); |
1569 std::string onc_path_to_auto_connect; | 1572 std::string onc_path_to_auto_connect; |
1570 if (type == flimflam::kTypeWifi) { | 1573 if (type == flimflam::kTypeWifi) { |
1571 onc_path_to_auto_connect = base::StringPrintf( | 1574 onc_path_to_auto_connect = base::StringPrintf( |
1572 "%s.%s", | 1575 "%s.%s", |
1573 onc::network_config::kWiFi, | 1576 onc::network_config::kWiFi, |
1574 onc::wifi::kAutoConnect); | 1577 onc::wifi::kAutoConnect); |
1575 } else if (type == flimflam::kTypeVPN) { | 1578 } else if (type == flimflam::kTypeVPN) { |
1576 onc_path_to_auto_connect = base::StringPrintf( | 1579 onc_path_to_auto_connect = base::StringPrintf( |
1577 "%s.%s", | 1580 "%s.%s", |
1578 onc::network_config::kVPN, | 1581 onc::network_config::kVPN, |
1579 onc::vpn::kAutoConnect); | 1582 onc::vpn::kAutoConnect); |
1580 } | 1583 } |
1581 if (!onc_path_to_auto_connect.empty()) { | 1584 if (!onc_path_to_auto_connect.empty()) { |
1582 auto_connect_ui_data.ParseOncProperty( | 1585 auto_connect_ui_data.ParseOncProperty( |
1583 onc_source, onc, onc_path_to_auto_connect); | 1586 onc_source, onc, onc_path_to_auto_connect); |
1584 } | 1587 } |
| 1588 bool auto_connect = false; |
| 1589 shill_properties.GetBooleanWithoutPathExpansion( |
| 1590 flimflam::kAutoConnectProperty, &auto_connect); |
1585 SetValueDictionary(&dictionary, kTagAutoConnect, | 1591 SetValueDictionary(&dictionary, kTagAutoConnect, |
1586 new base::FundamentalValue(network->auto_connect()), | 1592 new base::FundamentalValue(auto_connect), |
1587 auto_connect_ui_data); | 1593 auto_connect_ui_data); |
1588 | 1594 |
1589 PopulateConnectionDetails(network, shill_properties, &dictionary); | 1595 PopulateConnectionDetails(network, shill_properties, &dictionary); |
1590 | 1596 |
1591 // Show details dialog | 1597 // Show details dialog |
1592 web_ui()->CallJavascriptFunction(kShowDetailedInfoFunction, dictionary); | 1598 web_ui()->CallJavascriptFunction(kShowDetailedInfoFunction, dictionary); |
1593 } | 1599 } |
1594 | 1600 |
1595 namespace { | 1601 namespace { |
1596 | 1602 |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2029 cellular && cellular->support_network_scan()); | 2035 cellular && cellular->support_network_scan()); |
2030 | 2036 |
2031 dictionary->SetBoolean(kTagWimaxAvailable, | 2037 dictionary->SetBoolean(kTagWimaxAvailable, |
2032 handler->IsTechnologyAvailable(flimflam::kTypeWimax)); | 2038 handler->IsTechnologyAvailable(flimflam::kTypeWimax)); |
2033 dictionary->SetBoolean(kTagWimaxEnabled, | 2039 dictionary->SetBoolean(kTagWimaxEnabled, |
2034 handler->IsTechnologyEnabled(flimflam::kTypeWimax)); | 2040 handler->IsTechnologyEnabled(flimflam::kTypeWimax)); |
2035 } | 2041 } |
2036 | 2042 |
2037 } // namespace options | 2043 } // namespace options |
2038 } // namespace chromeos | 2044 } // namespace chromeos |
OLD | NEW |