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

Side by Side Diff: chrome/browser/autocomplete/history_quick_provider.h

Issue 7314018: Don't autocomplete searches of >1 word if they've only been visited once and the user has not yet... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_ 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_
6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_ 6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 27 matching lines...) Expand all
38 virtual void DeleteMatch(const AutocompleteMatch& match) OVERRIDE; 38 virtual void DeleteMatch(const AutocompleteMatch& match) OVERRIDE;
39 39
40 // Performs the autocomplete matching and scoring. 40 // Performs the autocomplete matching and scoring.
41 void DoAutocomplete(); 41 void DoAutocomplete();
42 42
43 private: 43 private:
44 friend class HistoryQuickProviderTest; 44 friend class HistoryQuickProviderTest;
45 FRIEND_TEST_ALL_PREFIXES(HistoryQuickProviderTest, Spans); 45 FRIEND_TEST_ALL_PREFIXES(HistoryQuickProviderTest, Spans);
46 FRIEND_TEST_ALL_PREFIXES(HistoryQuickProviderTest, Relevance); 46 FRIEND_TEST_ALL_PREFIXES(HistoryQuickProviderTest, Relevance);
47 47
48 // The initial maximum allowable score for a match which cannot be inlined.
49 static const int kMaxNonInliningScore;
50
48 // Creates an AutocompleteMatch from |history_match|. |max_match_score| gives 51 // Creates an AutocompleteMatch from |history_match|. |max_match_score| gives
49 // the maximum possible score for the match. 52 // the maximum possible score for the match.
50 AutocompleteMatch QuickMatchToACMatch( 53 AutocompleteMatch QuickMatchToACMatch(
51 const history::ScoredHistoryMatch& history_match, 54 const history::ScoredHistoryMatch& history_match,
52 bool prevent_inline_autocomplete, 55 bool prevent_inline_autocomplete,
53 int* max_match_score); 56 int* max_match_score);
54 57
55 // Determines the relevance score of |history_match|. The maximum allowed 58 // Determines the relevance score of |history_match|. The maximum allowed
56 // score for the match is passed in |max_match_score|. The |max_match_score| 59 // score for the match is passed in |max_match_score|. The |max_match_score|
57 // is always set to the resulting score minus 1 whenever the match's score 60 // is always set to the resulting score minus 1 whenever the match's score
(...skipping 16 matching lines...) Expand all
74 // Only for use in unittests. Takes ownership of |index|. 77 // Only for use in unittests. Takes ownership of |index|.
75 void SetIndexForTesting(history::InMemoryURLIndex* index); 78 void SetIndexForTesting(history::InMemoryURLIndex* index);
76 AutocompleteInput autocomplete_input_; 79 AutocompleteInput autocomplete_input_;
77 std::string languages_; 80 std::string languages_;
78 81
79 // Only used for testing. 82 // Only used for testing.
80 scoped_ptr<history::InMemoryURLIndex> index_for_testing_; 83 scoped_ptr<history::InMemoryURLIndex> index_for_testing_;
81 }; 84 };
82 85
83 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_ 86 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698