| 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/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/api/bookmarks/bookmark_service.h" | 9 #include "chrome/browser/api/bookmarks/bookmark_service.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 bool InMemoryURLIndex::GetCacheFilePath(FilePath* file_path) { | 150 bool InMemoryURLIndex::GetCacheFilePath(FilePath* file_path) { |
| 151 if (history_dir_.empty()) | 151 if (history_dir_.empty()) |
| 152 return false; | 152 return false; |
| 153 *file_path = history_dir_.Append(FILE_PATH_LITERAL("History Provider Cache")); | 153 *file_path = history_dir_.Append(FILE_PATH_LITERAL("History Provider Cache")); |
| 154 return true; | 154 return true; |
| 155 } | 155 } |
| 156 | 156 |
| 157 // Querying -------------------------------------------------------------------- | 157 // Querying -------------------------------------------------------------------- |
| 158 | 158 |
| 159 ScoredHistoryMatches InMemoryURLIndex::HistoryItemsForTerms( | 159 ScoredHistoryMatches InMemoryURLIndex::HistoryItemsForTerms( |
| 160 const string16& term_string) { | 160 const string16& term_string, |
| 161 size_t cursor_position) { |
| 161 return private_data_->HistoryItemsForTerms( | 162 return private_data_->HistoryItemsForTerms( |
| 162 term_string, BookmarkModelFactory::GetForProfile(profile_)); | 163 term_string, |
| 164 cursor_position, |
| 165 BookmarkModelFactory::GetForProfile(profile_)); |
| 163 } | 166 } |
| 164 | 167 |
| 165 // Updating -------------------------------------------------------------------- | 168 // Updating -------------------------------------------------------------------- |
| 166 | 169 |
| 167 void InMemoryURLIndex::DeleteURL(const GURL& url) { | 170 void InMemoryURLIndex::DeleteURL(const GURL& url) { |
| 168 private_data_->DeleteURL(url); | 171 private_data_->DeleteURL(url); |
| 169 } | 172 } |
| 170 | 173 |
| 171 void InMemoryURLIndex::Observe(int notification_type, | 174 void InMemoryURLIndex::Observe(int notification_type, |
| 172 const content::NotificationSource& source, | 175 const content::NotificationSource& source, |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 base::Bind(DeleteCacheFile, path)); | 331 base::Bind(DeleteCacheFile, path)); |
| 329 } | 332 } |
| 330 } | 333 } |
| 331 | 334 |
| 332 void InMemoryURLIndex::OnCacheSaveDone(bool succeeded) { | 335 void InMemoryURLIndex::OnCacheSaveDone(bool succeeded) { |
| 333 if (save_cache_observer_) | 336 if (save_cache_observer_) |
| 334 save_cache_observer_->OnCacheSaveFinished(succeeded); | 337 save_cache_observer_->OnCacheSaveFinished(succeeded); |
| 335 } | 338 } |
| 336 | 339 |
| 337 } // namespace history | 340 } // namespace history |
| OLD | NEW |