| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 : data_store_(data_store) { | 121 : data_store_(data_store) { |
| 122 Init(data_store_->cached_dict()); | 122 Init(data_store_->cached_dict()); |
| 123 } | 123 } |
| 124 | 124 |
| 125 HistoryDataStore::~HistoryDataStore() { | 125 HistoryDataStore::~HistoryDataStore() { |
| 126 } | 126 } |
| 127 | 127 |
| 128 void HistoryDataStore::Init(base::DictionaryValue* cached_dict) { | 128 void HistoryDataStore::Init(base::DictionaryValue* cached_dict) { |
| 129 DCHECK(cached_dict); | 129 DCHECK(cached_dict); |
| 130 cached_dict->SetString(kKeyVersion, kCurrentVersion); | 130 cached_dict->SetString(kKeyVersion, kCurrentVersion); |
| 131 cached_dict->Set(kKeyAssociations, new base::DictionaryValue); | 131 cached_dict->Set(kKeyAssociations, base::MakeUnique<base::DictionaryValue>()); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void HistoryDataStore::Flush( | 134 void HistoryDataStore::Flush( |
| 135 DictionaryDataStore::OnFlushedCallback on_flushed) { | 135 DictionaryDataStore::OnFlushedCallback on_flushed) { |
| 136 if (data_store_) | 136 if (data_store_) |
| 137 data_store_->Flush(std::move(on_flushed)); | 137 data_store_->Flush(std::move(on_flushed)); |
| 138 else | 138 else |
| 139 std::move(on_flushed).Run(); | 139 std::move(on_flushed).Run(); |
| 140 } | 140 } |
| 141 | 141 |
| (...skipping 74 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 |