OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/history/in_memory_url_index.h" | 5 #include "chrome/browser/history/in_memory_url_index.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 if (history_dir_.empty()) | 153 if (history_dir_.empty()) |
154 return false; | 154 return false; |
155 *file_path = history_dir_.Append(FILE_PATH_LITERAL("History Provider Cache")); | 155 *file_path = history_dir_.Append(FILE_PATH_LITERAL("History Provider Cache")); |
156 return true; | 156 return true; |
157 } | 157 } |
158 | 158 |
159 // Querying -------------------------------------------------------------------- | 159 // Querying -------------------------------------------------------------------- |
160 | 160 |
161 ScoredHistoryMatches InMemoryURLIndex::HistoryItemsForTerms( | 161 ScoredHistoryMatches InMemoryURLIndex::HistoryItemsForTerms( |
162 const base::string16& term_string, | 162 const base::string16& term_string, |
163 size_t cursor_position) { | 163 size_t cursor_position, |
| 164 size_t max_matches) { |
164 return private_data_->HistoryItemsForTerms( | 165 return private_data_->HistoryItemsForTerms( |
165 term_string, | 166 term_string, |
166 cursor_position, | 167 cursor_position, |
| 168 max_matches, |
167 languages_, | 169 languages_, |
168 BookmarkModelFactory::GetForProfile(profile_)); | 170 BookmarkModelFactory::GetForProfile(profile_)); |
169 } | 171 } |
170 | 172 |
171 // Updating -------------------------------------------------------------------- | 173 // Updating -------------------------------------------------------------------- |
172 | 174 |
173 void InMemoryURLIndex::DeleteURL(const GURL& url) { | 175 void InMemoryURLIndex::DeleteURL(const GURL& url) { |
174 private_data_->DeleteURL(url); | 176 private_data_->DeleteURL(url); |
175 } | 177 } |
176 | 178 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 base::Bind(DeleteCacheFile, path)); | 340 base::Bind(DeleteCacheFile, path)); |
339 } | 341 } |
340 } | 342 } |
341 | 343 |
342 void InMemoryURLIndex::OnCacheSaveDone(bool succeeded) { | 344 void InMemoryURLIndex::OnCacheSaveDone(bool succeeded) { |
343 if (save_cache_observer_) | 345 if (save_cache_observer_) |
344 save_cache_observer_->OnCacheSaveFinished(succeeded); | 346 save_cache_observer_->OnCacheSaveFinished(succeeded); |
345 } | 347 } |
346 | 348 |
347 } // namespace history | 349 } // namespace history |
OLD | NEW |