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.h" | 5 #include "ui/app_list/search/history_data.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 ++secondary_it) { | 122 ++secondary_it) { |
123 const std::string& secondary_result_id = (*secondary_it); | 123 const std::string& secondary_result_id = (*secondary_it); |
124 | 124 |
125 // Secondary match only gets added if there there is no primary match. | 125 // Secondary match only gets added if there there is no primary match. |
126 if (results->find(secondary_result_id) != results->end()) | 126 if (results->find(secondary_result_id) != results->end()) |
127 continue; | 127 continue; |
128 (*results)[secondary_result_id] = secondary_type; | 128 (*results)[secondary_result_id] = secondary_type; |
129 } | 129 } |
130 } | 130 } |
131 | 131 |
132 return results.Pass(); | 132 return results; |
133 } | 133 } |
134 | 134 |
135 void HistoryData::AddObserver(HistoryDataObserver* observer) { | 135 void HistoryData::AddObserver(HistoryDataObserver* observer) { |
136 observers_.AddObserver(observer); | 136 observers_.AddObserver(observer); |
137 } | 137 } |
138 | 138 |
139 void HistoryData::RemoveObserver(HistoryDataObserver* observer) { | 139 void HistoryData::RemoveObserver(HistoryDataObserver* observer) { |
140 observers_.RemoveObserver(observer); | 140 observers_.RemoveObserver(observer); |
141 } | 141 } |
142 | 142 |
(...skipping 23 matching lines...) Expand all Loading... |
166 &EntrySortByTimeAscending); | 166 &EntrySortByTimeAscending); |
167 | 167 |
168 for (size_t i = 0; i < entries_to_remove; ++i) { | 168 for (size_t i = 0; i < entries_to_remove; ++i) { |
169 const std::string& query = *entries[i].query; | 169 const std::string& query = *entries[i].query; |
170 store_->Delete(query); | 170 store_->Delete(query); |
171 associations_.erase(query); | 171 associations_.erase(query); |
172 } | 172 } |
173 } | 173 } |
174 | 174 |
175 } // namespace app_list | 175 } // namespace app_list |
OLD | NEW |