| 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 "chrome/browser/chromeos/cros/network_library.h" | 5 #include "chrome/browser/chromeos/cros/network_library.h" |
| 6 | 6 |
| 7 #include <dbus/dbus-glib.h> | 7 #include <dbus/dbus-glib.h> |
| 8 | 8 |
| 9 #include "base/i18n/icu_encoding_detection.h" | 9 #include "base/i18n/icu_encoding_detection.h" |
| 10 #include "base/i18n/icu_string_conversions.h" | 10 #include "base/i18n/icu_string_conversions.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 } | 223 } |
| 224 return; | 224 return; |
| 225 } | 225 } |
| 226 | 226 |
| 227 // Add the property to property_map_. Delete previous value if necessary. | 227 // Add the property to property_map_. Delete previous value if necessary. |
| 228 Value*& entry = property_map_[index]; | 228 Value*& entry = property_map_[index]; |
| 229 delete entry; | 229 delete entry; |
| 230 entry = value->DeepCopy(); | 230 entry = value->DeepCopy(); |
| 231 if (VLOG_IS_ON(2)) { | 231 if (VLOG_IS_ON(2)) { |
| 232 std::string value_json; | 232 std::string value_json; |
| 233 base::JSONWriter::Write(value, true, &value_json); | 233 base::JSONWriter::WriteWithOptions(value, |
| 234 base::JSONWriter::OPTIONS_PRETTY_PRINT, |
| 235 &value_json); |
| 234 VLOG(2) << "Updated property map on network: " | 236 VLOG(2) << "Updated property map on network: " |
| 235 << unique_id() << "[" << index << "] = " << value_json; | 237 << unique_id() << "[" << index << "] = " << value_json; |
| 236 } | 238 } |
| 237 } | 239 } |
| 238 | 240 |
| 239 bool Network::GetProperty(PropertyIndex index, | 241 bool Network::GetProperty(PropertyIndex index, |
| 240 const base::Value** value) const { | 242 const base::Value** value) const { |
| 241 PropertyMap::const_iterator i = property_map_.find(index); | 243 PropertyMap::const_iterator i = property_map_.find(index); |
| 242 if (i == property_map_.end()) | 244 if (i == property_map_.end()) |
| 243 return false; | 245 return false; |
| (...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1436 NetworkLibrary* impl; | 1438 NetworkLibrary* impl; |
| 1437 if (stub) | 1439 if (stub) |
| 1438 impl = new NetworkLibraryImplStub(); | 1440 impl = new NetworkLibraryImplStub(); |
| 1439 else | 1441 else |
| 1440 impl = new NetworkLibraryImplCros(); | 1442 impl = new NetworkLibraryImplCros(); |
| 1441 impl->Init(); | 1443 impl->Init(); |
| 1442 return impl; | 1444 return impl; |
| 1443 } | 1445 } |
| 1444 | 1446 |
| 1445 } // namespace chromeos | 1447 } // namespace chromeos |
| OLD | NEW |