OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 dictionary.SetBoolean("showSharedProxiesHint", | 697 dictionary.SetBoolean("showSharedProxiesHint", |
698 !proxy_configurable && !use_shared_proxies && | 698 !proxy_configurable && !use_shared_proxies && |
699 (remembered || type == chromeos::TYPE_ETHERNET)); | 699 (remembered || type == chromeos::TYPE_ETHERNET)); |
700 | 700 |
701 // Hide the dhcp/static radio if not ethernet or wifi (or if not enabled) | 701 // Hide the dhcp/static radio if not ethernet or wifi (or if not enabled) |
702 bool staticIPConfig = CommandLine::ForCurrentProcess()->HasSwitch( | 702 bool staticIPConfig = CommandLine::ForCurrentProcess()->HasSwitch( |
703 switches::kEnableStaticIPConfig); | 703 switches::kEnableStaticIPConfig); |
704 dictionary.SetBoolean("showStaticIPConfig", staticIPConfig && | 704 dictionary.SetBoolean("showStaticIPConfig", staticIPConfig && |
705 (type == chromeos::TYPE_WIFI || type == chromeos::TYPE_ETHERNET)); | 705 (type == chromeos::TYPE_WIFI || type == chromeos::TYPE_ETHERNET)); |
706 | 706 |
707 dictionary.SetBoolean("preferred", network->preferred()); | 707 if (network->profile_type() == chromeos::PROFILE_USER) { |
| 708 dictionary.SetBoolean("showPreferred", true); |
| 709 dictionary.SetBoolean("preferred", network->preferred()); |
| 710 } else { |
| 711 dictionary.SetBoolean("showPreferred", false); |
| 712 dictionary.SetBoolean("preferred", false); |
| 713 } |
708 dictionary.SetBoolean("autoConnect", network->auto_connect()); | 714 dictionary.SetBoolean("autoConnect", network->auto_connect()); |
709 | 715 |
710 if (type == chromeos::TYPE_WIFI) { | 716 if (type == chromeos::TYPE_WIFI) { |
711 dictionary.SetBoolean("deviceConnected", cros_->wifi_connected()); | 717 dictionary.SetBoolean("deviceConnected", cros_->wifi_connected()); |
712 const chromeos::WifiNetwork* wifi = | 718 const chromeos::WifiNetwork* wifi = |
713 cros_->FindWifiNetworkByPath(network->service_path()); | 719 cros_->FindWifiNetworkByPath(network->service_path()); |
714 if (!wifi) { | 720 if (!wifi) { |
715 LOG(WARNING) << "Cannot find network " << network->service_path(); | 721 LOG(WARNING) << "Cannot find network " << network->service_path(); |
716 } else { | 722 } else { |
717 PopulateWifiDetails(wifi, &dictionary); | 723 PopulateWifiDetails(wifi, &dictionary); |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1260 dictionary->SetBoolean("accessLocked", cros_->IsLocked()); | 1266 dictionary->SetBoolean("accessLocked", cros_->IsLocked()); |
1261 dictionary->Set("wiredList", GetWiredList()); | 1267 dictionary->Set("wiredList", GetWiredList()); |
1262 dictionary->Set("wirelessList", GetWirelessList()); | 1268 dictionary->Set("wirelessList", GetWirelessList()); |
1263 dictionary->Set("vpnList", GetVPNList()); | 1269 dictionary->Set("vpnList", GetVPNList()); |
1264 dictionary->Set("rememberedList", GetRememberedList()); | 1270 dictionary->Set("rememberedList", GetRememberedList()); |
1265 dictionary->SetBoolean("wifiAvailable", cros_->wifi_available()); | 1271 dictionary->SetBoolean("wifiAvailable", cros_->wifi_available()); |
1266 dictionary->SetBoolean("wifiEnabled", cros_->wifi_enabled()); | 1272 dictionary->SetBoolean("wifiEnabled", cros_->wifi_enabled()); |
1267 dictionary->SetBoolean("cellularAvailable", cros_->cellular_available()); | 1273 dictionary->SetBoolean("cellularAvailable", cros_->cellular_available()); |
1268 dictionary->SetBoolean("cellularEnabled", cros_->cellular_enabled()); | 1274 dictionary->SetBoolean("cellularEnabled", cros_->cellular_enabled()); |
1269 } | 1275 } |
OLD | NEW |