Chromium Code Reviews| Index: mojo/services/catalog/entry.cc |
| diff --git a/mojo/services/catalog/entry.cc b/mojo/services/catalog/entry.cc |
| index 528eee49d51f91cd9b6770bdedde7e28d1c8f004..2f1671f8e1f2455897d96e173b2fc0c29fd04cb6 100644 |
| --- a/mojo/services/catalog/entry.cc |
| +++ b/mojo/services/catalog/entry.cc |
| @@ -179,6 +179,19 @@ scoped_ptr<Entry> Entry::Deserialize(const base::DictionaryValue& value) { |
| entry->set_capabilities(BuildCapabilitiesV0(*capabilities)); |
| else |
| entry->set_capabilities(BuildCapabilitiesV1(*capabilities)); |
| + |
| + if (value.HasKey(Store::kApplicationsKey)) { |
| + const base::ListValue* applications = nullptr; |
| + value.GetList(Store::kApplicationsKey, &applications); |
| + for (size_t i = 0; i < applications->GetSize(); ++i) { |
| + const base::DictionaryValue* application = nullptr; |
| + applications->GetDictionary(i, &application); |
| + scoped_ptr<Entry> child = Entry::Deserialize(*application); |
| + if (child) |
| + entry->applications_.insert(*child); |
| + } |
| + } |
| + |
| return entry; |
| } |
| @@ -188,4 +201,10 @@ bool Entry::operator==(const Entry& other) const { |
| other.capabilities_ == capabilities_; |
| } |
| +bool Entry::operator<(const Entry& other) const { |
| + return other.name_ < name_ || other.qualifier_ < qualifier_ || |
|
sky
2016/03/22 23:47:46
Don't you only want to compare subsequent values i
|
| + other.display_name_ < display_name_ || |
| + other.capabilities_ < capabilities_; |
| +} |
| + |
| } // catalog |