| 528 | } |
| 529 | |
| 530 | int VariantUtilities::GetAllVariantObjectPropertyValues(IElementManager* element_manager, |
| 531 | VARIANT variant_value, |
| 532 | Json::Value* value) { |
| 533 | std::vector<std::wstring> property_names; |
| 534 | GetPropertyNameList(variant_value.pdispVal, &property_names); |
| 535 | |
| 536 | for (size_t i = 0; i < property_names.size(); ++i) { |
| 537 | CComVariant property_value_variant; |
| 538 | bool property_value_retrieved = |
| 539 | GetVariantObjectPropertyValue(variant_value.pdispVal, |
| 540 | property_names[i], |
| 541 | &property_value_variant); |
| 542 | if (!property_value_retrieved) { |
| 543 | LOG(WARN) << "Did not successfully get value for property '" |
| 544 | << StringUtilities::ToString(property_names[i]) |
| 545 | << "' from object."; |
| 546 | return EUNEXPECTEDJSERROR; |
| 547 | } |
| 548 | |
| 549 | Json::Value property_value; |
| 550 | ConvertVariantToJsonValue(element_manager, |
| 551 | property_value_variant, |
| 552 | &property_value); |
| 553 | |
| 554 | std::string name = StringUtilities::ToString(property_names[i]); |
| 555 | (*value)[name] = property_value; |
| 556 | } |
| 557 | |
| 558 | return WD_SUCCESS; |
| 559 | } |
| 560 | |
| 561 | } // namespace webdriver |