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 "chromeos/network/network_state.h" | 5 #include "chromeos/network/network_state.h" |
6 | 6 |
7 #include "base/i18n/icu_encoding_detection.h" | 7 #include "base/i18n/icu_encoding_detection.h" |
8 #include "base/i18n/icu_string_conversions.h" | 8 #include "base/i18n/icu_string_conversions.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 } else if (key == flimflam::kPriorityProperty) { | 98 } else if (key == flimflam::kPriorityProperty) { |
99 return GetIntegerValue(key, value, &priority_); | 99 return GetIntegerValue(key, value, &priority_); |
100 } else if (key == flimflam::kNetworkTechnologyProperty) { | 100 } else if (key == flimflam::kNetworkTechnologyProperty) { |
101 return GetStringValue(key, value, &technology_); | 101 return GetStringValue(key, value, &technology_); |
102 } else if (key == flimflam::kDeviceProperty) { | 102 } else if (key == flimflam::kDeviceProperty) { |
103 return GetStringValue(key, value, &device_path_); | 103 return GetStringValue(key, value, &device_path_); |
104 } else if (key == flimflam::kGuidProperty) { | 104 } else if (key == flimflam::kGuidProperty) { |
105 return GetStringValue(key, value, &guid_); | 105 return GetStringValue(key, value, &guid_); |
106 } else if (key == flimflam::kProfileProperty) { | 106 } else if (key == flimflam::kProfileProperty) { |
107 return GetStringValue(key, value, &profile_path_); | 107 return GetStringValue(key, value, &profile_path_); |
| 108 } else if (key == flimflam::kProxyConfigProperty) { |
| 109 return GetStringValue(key, value, &proxy_config_); |
108 } else if (key == shill::kActivateOverNonCellularNetworkProperty) { | 110 } else if (key == shill::kActivateOverNonCellularNetworkProperty) { |
109 return GetBooleanValue(key, value, &activate_over_non_cellular_networks_); | 111 return GetBooleanValue(key, value, &activate_over_non_cellular_networks_); |
110 } else if (key == shill::kOutOfCreditsProperty) { | 112 } else if (key == shill::kOutOfCreditsProperty) { |
111 return GetBooleanValue(key, value, &cellular_out_of_credits_); | 113 return GetBooleanValue(key, value, &cellular_out_of_credits_); |
112 } else if (key == flimflam::kWifiHexSsid) { | 114 } else if (key == flimflam::kWifiHexSsid) { |
113 return GetStringValue(key, value, &hex_ssid_); | 115 return GetStringValue(key, value, &hex_ssid_); |
114 } else if (key == flimflam::kCountryProperty) { | 116 } else if (key == flimflam::kCountryProperty) { |
115 // TODO(stevenjb): This is currently experimental. If we find a case where | 117 // TODO(stevenjb): This is currently experimental. If we find a case where |
116 // base::DetectEncoding() fails in UpdateName(), where country_code_ is | 118 // base::DetectEncoding() fails in UpdateName(), where country_code_ is |
117 // set, figure out whether we can use country_code_ with ConvertToUtf8(). | 119 // set, figure out whether we can use country_code_ with ConvertToUtf8(). |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 dictionary->SetIntegerWithoutPathExpansion(flimflam::kPriorityProperty, | 160 dictionary->SetIntegerWithoutPathExpansion(flimflam::kPriorityProperty, |
159 priority()); | 161 priority()); |
160 dictionary->SetStringWithoutPathExpansion( | 162 dictionary->SetStringWithoutPathExpansion( |
161 flimflam::kNetworkTechnologyProperty, | 163 flimflam::kNetworkTechnologyProperty, |
162 technology()); | 164 technology()); |
163 dictionary->SetStringWithoutPathExpansion(flimflam::kDeviceProperty, | 165 dictionary->SetStringWithoutPathExpansion(flimflam::kDeviceProperty, |
164 device_path()); | 166 device_path()); |
165 dictionary->SetStringWithoutPathExpansion(flimflam::kGuidProperty, guid()); | 167 dictionary->SetStringWithoutPathExpansion(flimflam::kGuidProperty, guid()); |
166 dictionary->SetStringWithoutPathExpansion(flimflam::kProfileProperty, | 168 dictionary->SetStringWithoutPathExpansion(flimflam::kProfileProperty, |
167 profile_path()); | 169 profile_path()); |
| 170 dictionary->SetStringWithoutPathExpansion(flimflam::kProxyConfigProperty, |
| 171 proxy_config()); |
168 dictionary->SetBooleanWithoutPathExpansion( | 172 dictionary->SetBooleanWithoutPathExpansion( |
169 shill::kActivateOverNonCellularNetworkProperty, | 173 shill::kActivateOverNonCellularNetworkProperty, |
170 activate_over_non_cellular_networks()); | 174 activate_over_non_cellular_networks()); |
171 dictionary->SetBooleanWithoutPathExpansion(shill::kOutOfCreditsProperty, | 175 dictionary->SetBooleanWithoutPathExpansion(shill::kOutOfCreditsProperty, |
172 cellular_out_of_credits()); | 176 cellular_out_of_credits()); |
173 } | 177 } |
174 | 178 |
175 bool NetworkState::IsConnectedState() const { | 179 bool NetworkState::IsConnectedState() const { |
176 return StateIsConnected(connection_state_); | 180 return StateIsConnected(connection_state_); |
177 } | 181 } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 connection_state == flimflam::kStateConfiguration || | 260 connection_state == flimflam::kStateConfiguration || |
257 connection_state == flimflam::kStateCarrier); | 261 connection_state == flimflam::kStateCarrier); |
258 } | 262 } |
259 | 263 |
260 // static | 264 // static |
261 std::string NetworkState::IPConfigProperty(const char* key) { | 265 std::string NetworkState::IPConfigProperty(const char* key) { |
262 return base::StringPrintf("%s.%s", shill::kIPConfigProperty, key); | 266 return base::StringPrintf("%s.%s", shill::kIPConfigProperty, key); |
263 } | 267 } |
264 | 268 |
265 } // namespace chromeos | 269 } // namespace chromeos |
OLD | NEW |