| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ui/app_list/search/history_data_store.h" | 5 #include "ui/app_list/search/history_data_store.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 const char kKeySecondary[] = "s"; | 28 const char kKeySecondary[] = "s"; |
| 29 const char kKeyUpdateTime[] = "t"; | 29 const char kKeyUpdateTime[] = "t"; |
| 30 | 30 |
| 31 // Extracts strings from ListValue. | 31 // Extracts strings from ListValue. |
| 32 void GetSecondary(const base::ListValue* list, | 32 void GetSecondary(const base::ListValue* list, |
| 33 HistoryData::SecondaryDeque* secondary) { | 33 HistoryData::SecondaryDeque* secondary) { |
| 34 HistoryData::SecondaryDeque results; | 34 HistoryData::SecondaryDeque results; |
| 35 for (base::ListValue::const_iterator it = list->begin(); it != list->end(); | 35 for (base::ListValue::const_iterator it = list->begin(); it != list->end(); |
| 36 ++it) { | 36 ++it) { |
| 37 std::string str; | 37 std::string str; |
| 38 if (!(*it)->GetAsString(&str)) | 38 if (!it->GetAsString(&str)) |
| 39 return; | 39 return; |
| 40 | 40 |
| 41 results.push_back(str); | 41 results.push_back(str); |
| 42 } | 42 } |
| 43 | 43 |
| 44 secondary->swap(results); | 44 secondary->swap(results); |
| 45 } | 45 } |
| 46 | 46 |
| 47 // V1 format json dictionary: | 47 // V1 format json dictionary: |
| 48 // { | 48 // { |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 OnLoadedCallback callback, | 216 OnLoadedCallback callback, |
| 217 std::unique_ptr<base::DictionaryValue> dict) { | 217 std::unique_ptr<base::DictionaryValue> dict) { |
| 218 if (!dict) { | 218 if (!dict) { |
| 219 callback.Run(nullptr); | 219 callback.Run(nullptr); |
| 220 } else { | 220 } else { |
| 221 callback.Run(Parse(std::move(dict))); | 221 callback.Run(Parse(std::move(dict))); |
| 222 } | 222 } |
| 223 } | 223 } |
| 224 | 224 |
| 225 } // namespace app_list | 225 } // namespace app_list |
| OLD | NEW |