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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 } // namespace | 52 } // namespace |
53 | 53 |
54 namespace chromeos { | 54 namespace chromeos { |
55 | 55 |
56 NetworkState::NetworkState(const std::string& path) | 56 NetworkState::NetworkState(const std::string& path) |
57 : ManagedState(MANAGED_TYPE_NETWORK, path), | 57 : ManagedState(MANAGED_TYPE_NETWORK, path), |
58 auto_connect_(false), | 58 auto_connect_(false), |
59 favorite_(false), | 59 favorite_(false), |
60 priority_(0), | 60 priority_(0), |
| 61 onc_source_(onc::ONC_SOURCE_NONE), |
61 signal_strength_(0), | 62 signal_strength_(0), |
62 connectable_(false), | 63 connectable_(false), |
63 passphrase_required_(false), | 64 passphrase_required_(false), |
64 activate_over_non_cellular_networks_(false), | 65 activate_over_non_cellular_networks_(false), |
65 cellular_out_of_credits_(false) { | 66 cellular_out_of_credits_(false) { |
66 } | 67 } |
67 | 68 |
68 NetworkState::~NetworkState() { | 69 NetworkState::~NetworkState() { |
69 } | 70 } |
70 | 71 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 dictionary->SetStringWithoutPathExpansion(flimflam::kRoamingStateProperty, | 161 dictionary->SetStringWithoutPathExpansion(flimflam::kRoamingStateProperty, |
161 roaming_); | 162 roaming_); |
162 dictionary->SetStringWithoutPathExpansion(flimflam::kSecurityProperty, | 163 dictionary->SetStringWithoutPathExpansion(flimflam::kSecurityProperty, |
163 security_); | 164 security_); |
164 dictionary->SetBooleanWithoutPathExpansion(flimflam::kAutoConnectProperty, | 165 dictionary->SetBooleanWithoutPathExpansion(flimflam::kAutoConnectProperty, |
165 auto_connect_); | 166 auto_connect_); |
166 dictionary->SetBooleanWithoutPathExpansion(flimflam::kFavoriteProperty, | 167 dictionary->SetBooleanWithoutPathExpansion(flimflam::kFavoriteProperty, |
167 favorite_); | 168 favorite_); |
168 dictionary->SetIntegerWithoutPathExpansion(flimflam::kPriorityProperty, | 169 dictionary->SetIntegerWithoutPathExpansion(flimflam::kPriorityProperty, |
169 priority_); | 170 priority_); |
| 171 // Proxy config and ONC source is intentionally omitted: These properties are |
| 172 // placed in NetworkState to transition ProxyConfigServiceImpl from |
| 173 // NetworkLibrary to the new network stack. The networking extension API |
| 174 // shouldn't depend on this member. Once ManagedNetworkConfigurationHandler |
| 175 // is used instead of NetworkLibrary, we can remove them again. |
170 dictionary->SetStringWithoutPathExpansion( | 176 dictionary->SetStringWithoutPathExpansion( |
171 flimflam::kNetworkTechnologyProperty, | 177 flimflam::kNetworkTechnologyProperty, |
172 technology_); | 178 technology_); |
173 dictionary->SetStringWithoutPathExpansion(flimflam::kDeviceProperty, | 179 dictionary->SetStringWithoutPathExpansion(flimflam::kDeviceProperty, |
174 device_path_); | 180 device_path_); |
175 dictionary->SetStringWithoutPathExpansion(flimflam::kGuidProperty, guid_); | 181 dictionary->SetStringWithoutPathExpansion(flimflam::kGuidProperty, guid_); |
176 dictionary->SetStringWithoutPathExpansion(flimflam::kProfileProperty, | 182 dictionary->SetStringWithoutPathExpansion(flimflam::kProfileProperty, |
177 profile_path_); | 183 profile_path_); |
178 dictionary->SetBooleanWithoutPathExpansion( | 184 dictionary->SetBooleanWithoutPathExpansion( |
179 shill::kActivateOverNonCellularNetworkProperty, | 185 shill::kActivateOverNonCellularNetworkProperty, |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 connection_state == flimflam::kStateConfiguration || | 272 connection_state == flimflam::kStateConfiguration || |
267 connection_state == flimflam::kStateCarrier); | 273 connection_state == flimflam::kStateCarrier); |
268 } | 274 } |
269 | 275 |
270 // static | 276 // static |
271 std::string NetworkState::IPConfigProperty(const char* key) { | 277 std::string NetworkState::IPConfigProperty(const char* key) { |
272 return base::StringPrintf("%s.%s", shill::kIPConfigProperty, key); | 278 return base::StringPrintf("%s.%s", shill::kIPConfigProperty, key); |
273 } | 279 } |
274 | 280 |
275 } // namespace chromeos | 281 } // namespace chromeos |
OLD | NEW |