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

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

Issue 6652008: Implemented substring matching within page titles. Fixed bug where URL was be... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/autocomplete/history_quick_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/history_quick_provider.h
===================================================================
--- chrome/browser/autocomplete/history_quick_provider.h (revision 77643)
+++ chrome/browser/autocomplete/history_quick_provider.h (working copy)
@@ -8,11 +8,13 @@
#include <string>
+#include "chrome/browser/autocomplete/autocomplete_match.h"
#include "chrome/browser/autocomplete/history_provider.h"
#include "chrome/browser/history/history_types.h"
#include "chrome/browser/history/in_memory_url_index.h"
class Profile;
+class TermMatches;
namespace history {
class HistoryBackend;
@@ -40,17 +42,12 @@
private:
friend class HistoryQuickProviderTest;
+ FRIEND_TEST_ALL_PREFIXES(HistoryQuickProviderTest, Spans);
AutocompleteMatch QuickMatchToACMatch(
const history::ScoredHistoryMatch& history_match,
- MatchType match_type,
size_t match_number);
- // Breaks a string down into individual words and return as a vector with
- // the individual words in their original order.
- static history::InMemoryURLIndex::String16Vector WordVectorFromString16(
- const string16& uni_string);
-
// Determines the relevance for some input, given its type and which match it
// is. If |match_type| is NORMAL, |match_number| is a number
// [0, kMaxSuggestions) indicating the relevance of the match (higher == more
@@ -63,10 +60,18 @@
// Returns the index that should be used for history lookups.
history::InMemoryURLIndex* GetIndex();
+ // Fill and return an ACMatchClassifications structure given the term
+ // matches (|matches|) to highlight where terms were found. |adjust| is
+ // subtracted form each offset and is used to account for any leading
+ // 'http://' in the potential result.
+ static ACMatchClassifications SpansFromTermMatch(
+ const history::TermMatches& matches,
+ size_t text_length,
+ size_t adjust);
+
// Only for use in unittests. Takes ownership of |index|.
void SetIndexForTesting(history::InMemoryURLIndex* index);
AutocompleteInput autocomplete_input_;
- bool trim_http_;
std::string languages_;
// Only used for testing.
« no previous file with comments | « no previous file | chrome/browser/autocomplete/history_quick_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698