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/dbus/shill_client_helper.h" | 5 #include "chromeos/dbus/shill_client_helper.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 } | 458 } |
459 case base::Value::Type::LIST: { | 459 case base::Value::Type::LIST: { |
460 const base::ListValue* list = NULL; | 460 const base::ListValue* list = NULL; |
461 value.GetAsList(&list); | 461 value.GetAsList(&list); |
462 dbus::MessageWriter variant_writer(NULL); | 462 dbus::MessageWriter variant_writer(NULL); |
463 writer->OpenVariant("as", &variant_writer); | 463 writer->OpenVariant("as", &variant_writer); |
464 dbus::MessageWriter array_writer(NULL); | 464 dbus::MessageWriter array_writer(NULL); |
465 variant_writer.OpenArray("s", &array_writer); | 465 variant_writer.OpenArray("s", &array_writer); |
466 for (base::ListValue::const_iterator it = list->begin(); | 466 for (base::ListValue::const_iterator it = list->begin(); |
467 it != list->end(); ++it) { | 467 it != list->end(); ++it) { |
468 const base::Value& value = *it; | 468 const base::Value& value = **it; |
469 std::string value_string; | 469 std::string value_string; |
470 if (!value.GetAsString(&value_string)) | 470 if (!value.GetAsString(&value_string)) |
471 NET_LOG(ERROR) << "List value not a string: " << value; | 471 NET_LOG(ERROR) << "List value not a string: " << value; |
472 array_writer.AppendString(value_string); | 472 array_writer.AppendString(value_string); |
473 } | 473 } |
474 variant_writer.CloseContainer(&array_writer); | 474 variant_writer.CloseContainer(&array_writer); |
475 writer->CloseContainer(&variant_writer); | 475 writer->CloseContainer(&variant_writer); |
476 break; | 476 break; |
477 } | 477 } |
478 case base::Value::Type::BOOLEAN: | 478 case base::Value::Type::BOOLEAN: |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 return; | 545 return; |
546 std::unique_ptr<base::Value> value(dbus::PopDataAsValue(&reader)); | 546 std::unique_ptr<base::Value> value(dbus::PopDataAsValue(&reader)); |
547 if (!value.get()) | 547 if (!value.get()) |
548 return; | 548 return; |
549 | 549 |
550 for (auto& observer : observer_list_) | 550 for (auto& observer : observer_list_) |
551 observer.OnPropertyChanged(name, *value); | 551 observer.OnPropertyChanged(name, *value); |
552 } | 552 } |
553 | 553 |
554 } // namespace chromeos | 554 } // namespace chromeos |
OLD | NEW |