| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 // must replicate that nested structure. | 252 // must replicate that nested structure. |
| 253 std::unique_ptr<base::DictionaryValue> provider_property( | 253 std::unique_ptr<base::DictionaryValue> provider_property( |
| 254 new base::DictionaryValue); | 254 new base::DictionaryValue); |
| 255 provider_property->SetStringWithoutPathExpansion(shill::kTypeProperty, | 255 provider_property->SetStringWithoutPathExpansion(shill::kTypeProperty, |
| 256 vpn_provider_type_); | 256 vpn_provider_type_); |
| 257 if (vpn_provider_type_ == shill::kProviderThirdPartyVpn) { | 257 if (vpn_provider_type_ == shill::kProviderThirdPartyVpn) { |
| 258 provider_property->SetStringWithoutPathExpansion( | 258 provider_property->SetStringWithoutPathExpansion( |
| 259 shill::kHostProperty, third_party_vpn_provider_extension_id_); | 259 shill::kHostProperty, third_party_vpn_provider_extension_id_); |
| 260 } | 260 } |
| 261 dictionary->SetWithoutPathExpansion(shill::kProviderProperty, | 261 dictionary->SetWithoutPathExpansion(shill::kProviderProperty, |
| 262 provider_property.release()); | 262 std::move(provider_property)); |
| 263 } | 263 } |
| 264 | 264 |
| 265 // Tether properties | 265 // Tether properties |
| 266 if (NetworkTypePattern::Tether().MatchesType(type())) { | 266 if (NetworkTypePattern::Tether().MatchesType(type())) { |
| 267 dictionary->SetIntegerWithoutPathExpansion(kTetherBatteryPercentage, | 267 dictionary->SetIntegerWithoutPathExpansion(kTetherBatteryPercentage, |
| 268 battery_percentage()); | 268 battery_percentage()); |
| 269 dictionary->SetStringWithoutPathExpansion(kTetherCarrier, carrier()); | 269 dictionary->SetStringWithoutPathExpansion(kTetherCarrier, carrier()); |
| 270 dictionary->SetIntegerWithoutPathExpansion(kTetherSignalStrength, | 270 dictionary->SetIntegerWithoutPathExpansion(kTetherSignalStrength, |
| 271 signal_strength()); | 271 signal_strength()); |
| 272 } | 272 } |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 return IsCaptivePortalState(shill_properties, false /* log */); | 460 return IsCaptivePortalState(shill_properties, false /* log */); |
| 461 } | 461 } |
| 462 | 462 |
| 463 // static | 463 // static |
| 464 bool NetworkState::ErrorIsValid(const std::string& error) { | 464 bool NetworkState::ErrorIsValid(const std::string& error) { |
| 465 // Shill uses "Unknown" to indicate an unset or cleared error state. | 465 // Shill uses "Unknown" to indicate an unset or cleared error state. |
| 466 return !error.empty() && error != kErrorUnknown; | 466 return !error.empty() && error != kErrorUnknown; |
| 467 } | 467 } |
| 468 | 468 |
| 469 } // namespace chromeos | 469 } // namespace chromeos |
| OLD | NEW |