Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Unified Diff: chrome/browser/autocomplete/history_quick_provider.cc

Issue 8291005: HQP Refactoring (in Preparation for SQLite Cache) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Rattle those Bots Senseless Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/autocomplete/history_quick_provider.cc
===================================================================
--- chrome/browser/autocomplete/history_quick_provider.cc (revision 105497)
+++ chrome/browser/autocomplete/history_quick_provider.cc (working copy)
@@ -16,6 +16,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/history/history.h"
#include "chrome/browser/history/in_memory_url_index.h"
+#include "chrome/browser/history/in_memory_url_index_types.h"
#include "chrome/browser/net/url_fixer_upper.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
@@ -81,8 +82,7 @@
}
}
-// HistoryQuickProvider matches are currently not deletable.
-// TODO(mrossetti): Determine when a match should be deletable.
+// TODO(mrossetti): Implement this function. (Will happen in next CL.)
void HistoryQuickProvider::DeleteMatch(const AutocompleteMatch& match) {}
void HistoryQuickProvider::DoAutocomplete() {
@@ -90,8 +90,8 @@
string16 term_string = autocomplete_input_.text();
term_string = net::UnescapeURLComponent(term_string,
UnescapeRule::SPACES | UnescapeRule::URL_SPECIAL_CHARS);
- history::InMemoryURLIndex::String16Vector terms(
- InMemoryURLIndex::WordVectorFromString16(term_string, false));
+ history::String16Vector terms(
+ history::String16VectorFromString16(term_string, false));
ScoredHistoryMatches matches = GetIndex()->HistoryItemsForTerms(terms);
if (matches.empty())
return;
@@ -131,13 +131,12 @@
// Format the URL autocomplete presentation.
std::vector<size_t> offsets =
- InMemoryURLIndex::OffsetsFromTermMatches(history_match.url_matches);
+ history::OffsetsFromTermMatches(history_match.url_matches);
match.contents =
net::FormatUrlWithOffsets(info.url(), languages_, net::kFormatUrlOmitAll,
UnescapeRule::SPACES, NULL, NULL, &offsets);
history::TermMatches new_matches =
- InMemoryURLIndex::ReplaceOffsetsInTermMatches(history_match.url_matches,
- offsets);
+ ReplaceOffsetsInTermMatches(history_match.url_matches, offsets);
match.contents_class =
SpansFromTermMatch(new_matches, match.contents.length(), true);
match.fill_into_edit = match.contents;
@@ -170,7 +169,8 @@
return history_service->InMemoryIndex();
}
-void HistoryQuickProvider::SetIndexForTesting(
+// TODO(mrossetti): This will be inlined in the next CL.
+void HistoryQuickProvider::set_index(
history::InMemoryURLIndex* index) {
DCHECK(index);
index_for_testing_.reset(index);
« no previous file with comments | « chrome/browser/autocomplete/history_quick_provider.h ('k') | chrome/browser/autocomplete/history_quick_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698