| 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 #include <utility> | 10 #include <utility> |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 shill::kHostProperty, &third_party_vpn_provider_extension_id_)) { | 194 shill::kHostProperty, &third_party_vpn_provider_extension_id_)) { |
| 195 NET_LOG(ERROR) << "Failed to parse " << path() << "." << key; | 195 NET_LOG(ERROR) << "Failed to parse " << path() << "." << key; |
| 196 return false; | 196 return false; |
| 197 } | 197 } |
| 198 } else { | 198 } else { |
| 199 third_party_vpn_provider_extension_id_.clear(); | 199 third_party_vpn_provider_extension_id_.clear(); |
| 200 } | 200 } |
| 201 | 201 |
| 202 vpn_provider_type_ = vpn_provider_type; | 202 vpn_provider_type_ = vpn_provider_type; |
| 203 return true; | 203 return true; |
| 204 } else if (key == shill::kTetheringProperty) { |
| 205 return GetStringValue(key, value, &tethering_state_); |
| 204 } | 206 } |
| 205 return false; | 207 return false; |
| 206 } | 208 } |
| 207 | 209 |
| 208 bool NetworkState::InitialPropertiesReceived( | 210 bool NetworkState::InitialPropertiesReceived( |
| 209 const base::DictionaryValue& properties) { | 211 const base::DictionaryValue& properties) { |
| 210 NET_LOG(EVENT) << "InitialPropertiesReceived: " << path() << ": " << name() | 212 NET_LOG(EVENT) << "InitialPropertiesReceived: " << path() << ": " << name() |
| 211 << " State: " << connection_state_ << " Visible: " << visible_; | 213 << " State: " << connection_state_ << " Visible: " << visible_; |
| 212 if (!properties.HasKey(shill::kTypeProperty)) { | 214 if (!properties.HasKey(shill::kTypeProperty)) { |
| 213 NET_LOG(ERROR) << "NetworkState has no type: " | 215 NET_LOG(ERROR) << "NetworkState has no type: " |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 return IsCaptivePortalState(shill_properties, false /* log */); | 466 return IsCaptivePortalState(shill_properties, false /* log */); |
| 465 } | 467 } |
| 466 | 468 |
| 467 // static | 469 // static |
| 468 bool NetworkState::ErrorIsValid(const std::string& error) { | 470 bool NetworkState::ErrorIsValid(const std::string& error) { |
| 469 // Shill uses "Unknown" to indicate an unset or cleared error state. | 471 // Shill uses "Unknown" to indicate an unset or cleared error state. |
| 470 return !error.empty() && error != kErrorUnknown; | 472 return !error.empty() && error != kErrorUnknown; |
| 471 } | 473 } |
| 472 | 474 |
| 473 } // namespace chromeos | 475 } // namespace chromeos |
| OLD | NEW |