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/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chromeos/network/network_event_log.h" | 9 #include "chromeos/network/network_event_log.h" |
10 #include "chromeos/network/network_profile_handler.h" | 10 #include "chromeos/network/network_profile_handler.h" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 result += ","; | 245 result += ","; |
246 result += dns_servers_[i]; | 246 result += dns_servers_[i]; |
247 } | 247 } |
248 return result; | 248 return result; |
249 } | 249 } |
250 | 250 |
251 std::string NetworkState::GetNetmask() const { | 251 std::string NetworkState::GetNetmask() const { |
252 return network_util::PrefixLengthToNetmask(prefix_length_); | 252 return network_util::PrefixLengthToNetmask(prefix_length_); |
253 } | 253 } |
254 | 254 |
| 255 void NetworkState::SetGuid(const std::string& guid) { |
| 256 guid_ = guid; |
| 257 } |
| 258 |
255 bool NetworkState::UpdateName(const base::DictionaryValue& properties) { | 259 bool NetworkState::UpdateName(const base::DictionaryValue& properties) { |
256 std::string updated_name = | 260 std::string updated_name = |
257 shill_property_util::GetNameFromProperties(path(), properties); | 261 shill_property_util::GetNameFromProperties(path(), properties); |
258 if (updated_name != name()) { | 262 if (updated_name != name()) { |
259 set_name(updated_name); | 263 set_name(updated_name); |
260 return true; | 264 return true; |
261 } | 265 } |
262 return false; | 266 return false; |
263 } | 267 } |
264 | 268 |
(...skipping 11 matching lines...) Expand all Loading... |
276 connection_state == shill::kStateCarrier); | 280 connection_state == shill::kStateCarrier); |
277 } | 281 } |
278 | 282 |
279 // static | 283 // static |
280 bool NetworkState::ErrorIsValid(const std::string& error) { | 284 bool NetworkState::ErrorIsValid(const std::string& error) { |
281 // Shill uses "Unknown" to indicate an unset or cleared error state. | 285 // Shill uses "Unknown" to indicate an unset or cleared error state. |
282 return !error.empty() && error != kErrorUnknown; | 286 return !error.empty() && error != kErrorUnknown; |
283 } | 287 } |
284 | 288 |
285 } // namespace chromeos | 289 } // namespace chromeos |
OLD | NEW |