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

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

Issue 6758031: Implement a simple Extension App Omnibox provider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_AUTOCOMPLETE_H_ 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_
6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 25 matching lines...) Expand all
36 // their own thread management when they need to return matches asynchronously. 36 // their own thread management when they need to return matches asynchronously.
37 // 37 //
38 // The AutocompleteProviders each return different kinds of matches, such as 38 // The AutocompleteProviders each return different kinds of matches, such as
39 // history or search matches. These matches are given "relevance" scores. 39 // history or search matches. These matches are given "relevance" scores.
40 // Higher scores are better matches than lower scores. The relevance scores and 40 // Higher scores are better matches than lower scores. The relevance scores and
41 // classes providing the respective matches are as follows: 41 // classes providing the respective matches are as follows:
42 // 42 //
43 // UNKNOWN input type: 43 // UNKNOWN input type:
44 // --------------------------------------------------------------------|----- 44 // --------------------------------------------------------------------|-----
45 // Keyword (non-substituting or in keyword UI mode, exact match) | 1500 45 // Keyword (non-substituting or in keyword UI mode, exact match) | 1500
46 // Extension App (exact match) | 1425
46 // HistoryURL (exact or inline autocomplete match) | 1400 47 // HistoryURL (exact or inline autocomplete match) | 1400
47 // Search Primary Provider (past query in history within 2 days) | 1399** 48 // Search Primary Provider (past query in history within 2 days) | 1399**
48 // Search Primary Provider (what you typed) | 1300 49 // Search Primary Provider (what you typed) | 1300
49 // HistoryURL (what you typed) | 1200 50 // HistoryURL (what you typed) | 1200
51 // Extension App (inexact match) | 1175*~
50 // Keyword (substituting, exact match) | 1100 52 // Keyword (substituting, exact match) | 1100
51 // Search Primary Provider (past query in history older than 2 days) | 1050-- 53 // Search Primary Provider (past query in history older than 2 days) | 1050--
52 // HistoryContents (any match in title of starred page) | 1000++ 54 // HistoryContents (any match in title of starred page) | 1000++
53 // HistoryURL (inexact match) | 900++ 55 // HistoryURL (inexact match) | 900++
54 // Search Primary Provider (navigational suggestion) | 800++ 56 // Search Primary Provider (navigational suggestion) | 800++
55 // HistoryContents (any match in title of nonstarred page) | 700++ 57 // HistoryContents (any match in title of nonstarred page) | 700++
56 // Search Primary Provider (suggestion) | 600++ 58 // Search Primary Provider (suggestion) | 600++
57 // Built-in | 575++ 59 // Built-in | 575++
58 // HistoryContents (any match in body of starred page) | 550++ 60 // HistoryContents (any match in body of starred page) | 550++
59 // HistoryContents (any match in body of nonstarred page) | 500++ 61 // HistoryContents (any match in body of nonstarred page) | 500++
60 // Keyword (inexact match) | 450 62 // Keyword (inexact match) | 450
61 // Search Secondary Provider (what you typed) | 250 63 // Search Secondary Provider (what you typed) | 250
62 // Search Secondary Provider (past query in history) | 200-- 64 // Search Secondary Provider (past query in history) | 200--
63 // Search Secondary Provider (navigational suggestion) | 150++ 65 // Search Secondary Provider (navigational suggestion) | 150++
64 // Search Secondary Provider (suggestion) | 100++ 66 // Search Secondary Provider (suggestion) | 100++
65 // 67 //
66 // REQUESTED_URL input type: 68 // REQUESTED_URL input type:
67 // --------------------------------------------------------------------|----- 69 // --------------------------------------------------------------------|-----
68 // Keyword (non-substituting or in keyword UI mode, exact match) | 1500 70 // Keyword (non-substituting or in keyword UI mode, exact match) | 1500
71 // Extension App (exact match) | 1425
69 // HistoryURL (exact or inline autocomplete match) | 1400 72 // HistoryURL (exact or inline autocomplete match) | 1400
70 // Search Primary Provider (past query in history within 2 days) | 1399** 73 // Search Primary Provider (past query in history within 2 days) | 1399**
71 // HistoryURL (what you typed) | 1200 74 // HistoryURL (what you typed) | 1200
75 // Extension App (inexact match) | 1175*~
72 // Search Primary Provider (what you typed) | 1150 76 // Search Primary Provider (what you typed) | 1150
73 // Keyword (substituting, exact match) | 1100 77 // Keyword (substituting, exact match) | 1100
74 // Search Primary Provider (past query in history older than 2 days) | 1050-- 78 // Search Primary Provider (past query in history older than 2 days) | 1050--
75 // HistoryContents (any match in title of starred page) | 1000++ 79 // HistoryContents (any match in title of starred page) | 1000++
76 // HistoryURL (inexact match) | 900++ 80 // HistoryURL (inexact match) | 900++
77 // Search Primary Provider (navigational suggestion) | 800++ 81 // Search Primary Provider (navigational suggestion) | 800++
78 // HistoryContents (any match in title of nonstarred page) | 700++ 82 // HistoryContents (any match in title of nonstarred page) | 700++
79 // Search Primary Provider (suggestion) | 600++ 83 // Search Primary Provider (suggestion) | 600++
80 // Built-in | 575++ 84 // Built-in | 575++
81 // HistoryContents (any match in body of starred page) | 550++ 85 // HistoryContents (any match in body of starred page) | 550++
82 // HistoryContents (any match in body of nonstarred page) | 500++ 86 // HistoryContents (any match in body of nonstarred page) | 500++
83 // Keyword (inexact match) | 450 87 // Keyword (inexact match) | 450
84 // Search Secondary Provider (what you typed) | 250 88 // Search Secondary Provider (what you typed) | 250
85 // Search Secondary Provider (past query in history) | 200-- 89 // Search Secondary Provider (past query in history) | 200--
86 // Search Secondary Provider (navigational suggestion) | 150++ 90 // Search Secondary Provider (navigational suggestion) | 150++
87 // Search Secondary Provider (suggestion) | 100++ 91 // Search Secondary Provider (suggestion) | 100++
88 // 92 //
89 // URL input type: 93 // URL input type:
90 // --------------------------------------------------------------------|----- 94 // --------------------------------------------------------------------|-----
91 // Keyword (non-substituting or in keyword UI mode, exact match) | 1500 95 // Keyword (non-substituting or in keyword UI mode, exact match) | 1500
96 // Extension App (exact match) | 1425
92 // HistoryURL (exact or inline autocomplete match) | 1400 97 // HistoryURL (exact or inline autocomplete match) | 1400
93 // HistoryURL (what you typed) | 1200 98 // HistoryURL (what you typed) | 1200
99 // Extension App (inexact match) | 1175*~
94 // Keyword (substituting, exact match) | 1100 100 // Keyword (substituting, exact match) | 1100
95 // HistoryURL (inexact match) | 900++ 101 // HistoryURL (inexact match) | 900++
96 // Search Primary Provider (what you typed) | 850 102 // Search Primary Provider (what you typed) | 850
97 // Search Primary Provider (navigational suggestion) | 800++ 103 // Search Primary Provider (navigational suggestion) | 800++
98 // Search Primary Provider (past query in history) | 750-- 104 // Search Primary Provider (past query in history) | 750--
99 // Keyword (inexact match) | 700 105 // Keyword (inexact match) | 700
100 // Built-in | 575++ 106 // Built-in | 575++
101 // Search Primary Provider (suggestion) | 300++ 107 // Search Primary Provider (suggestion) | 300++
102 // Search Secondary Provider (what you typed) | 250 108 // Search Secondary Provider (what you typed) | 250
103 // Search Secondary Provider (past query in history) | 200-- 109 // Search Secondary Provider (past query in history) | 200--
104 // Search Secondary Provider (navigational suggestion) | 150++ 110 // Search Secondary Provider (navigational suggestion) | 150++
105 // Search Secondary Provider (suggestion) | 100++ 111 // Search Secondary Provider (suggestion) | 100++
106 // 112 //
107 // QUERY input type: 113 // QUERY input type:
108 // --------------------------------------------------------------------|----- 114 // --------------------------------------------------------------------|-----
109 // Keyword (non-substituting or in keyword UI mode, exact match) | 1500 115 // Keyword (non-substituting or in keyword UI mode, exact match) | 1500
110 // Keyword (substituting, exact match) | 1450 116 // Keyword (substituting, exact match) | 1450
117 // Extension App (exact match) | 1425
111 // HistoryURL (exact or inline autocomplete match) | 1400 118 // HistoryURL (exact or inline autocomplete match) | 1400
112 // Search Primary Provider (past query in history within 2 days) | 1399** 119 // Search Primary Provider (past query in history within 2 days) | 1399**
113 // Search Primary Provider (what you typed) | 1300 120 // Search Primary Provider (what you typed) | 1300
121 // Extension App (inexact match) | 1175*~
114 // Search Primary Provider (past query in history older than 2 days) | 1050-- 122 // Search Primary Provider (past query in history older than 2 days) | 1050--
115 // HistoryContents (any match in title of starred page) | 1000++ 123 // HistoryContents (any match in title of starred page) | 1000++
116 // HistoryURL (inexact match) | 900++ 124 // HistoryURL (inexact match) | 900++
117 // Search Primary Provider (navigational suggestion) | 800++ 125 // Search Primary Provider (navigational suggestion) | 800++
118 // HistoryContents (any match in title of nonstarred page) | 700++ 126 // HistoryContents (any match in title of nonstarred page) | 700++
119 // Search Primary Provider (suggestion) | 600++ 127 // Search Primary Provider (suggestion) | 600++
120 // HistoryContents (any match in body of starred page) | 550++ 128 // HistoryContents (any match in body of starred page) | 550++
121 // HistoryContents (any match in body of nonstarred page) | 500++ 129 // HistoryContents (any match in body of nonstarred page) | 500++
122 // Keyword (inexact match) | 450 130 // Keyword (inexact match) | 450
123 // Search Secondary Provider (what you typed) | 250 131 // Search Secondary Provider (what you typed) | 250
124 // Search Secondary Provider (past query in history) | 200-- 132 // Search Secondary Provider (past query in history) | 200--
125 // Search Secondary Provider (navigational suggestion) | 150++ 133 // Search Secondary Provider (navigational suggestion) | 150++
126 // Search Secondary Provider (suggestion) | 100++ 134 // Search Secondary Provider (suggestion) | 100++
127 // 135 //
128 // FORCED_QUERY input type: 136 // FORCED_QUERY input type:
129 // --------------------------------------------------------------------|----- 137 // --------------------------------------------------------------------|-----
138 // Extension App (exact match on title only, not url) | 1425
130 // Search Primary Provider (past query in history within 2 days) | 1399** 139 // Search Primary Provider (past query in history within 2 days) | 1399**
131 // Search Primary Provider (what you typed) | 1300 140 // Search Primary Provider (what you typed) | 1300
141 // Extension App (inexact match on title only, not url) | 1175*~
132 // Search Primary Provider (past query in history older than 2 days) | 1050-- 142 // Search Primary Provider (past query in history older than 2 days) | 1050--
133 // HistoryContents (any match in title of starred page) | 1000++ 143 // HistoryContents (any match in title of starred page) | 1000++
134 // Search Primary Provider (navigational suggestion) | 800++ 144 // Search Primary Provider (navigational suggestion) | 800++
135 // HistoryContents (any match in title of nonstarred page) | 700++ 145 // HistoryContents (any match in title of nonstarred page) | 700++
136 // Search Primary Provider (suggestion) | 600++ 146 // Search Primary Provider (suggestion) | 600++
137 // HistoryContents (any match in body of starred page) | 550++ 147 // HistoryContents (any match in body of starred page) | 550++
138 // HistoryContents (any match in body of nonstarred page) | 500++ 148 // HistoryContents (any match in body of nonstarred page) | 500++
139 // 149 //
140 // (A search keyword is a keyword with a replacement string; a bookmark keyword 150 // (A search keyword is a keyword with a replacement string; a bookmark keyword
141 // is a keyword with no replacement string, that is, a shortcut for a URL.) 151 // is a keyword with no replacement string, that is, a shortcut for a URL.)
142 // 152 //
143 // There are two possible providers for search suggestions. If the user has 153 // There are two possible providers for search suggestions. If the user has
144 // typed a keyword, then the primary provider is the keyword provider and the 154 // typed a keyword, then the primary provider is the keyword provider and the
145 // secondary provider is the default provider. If the user has not typed a 155 // secondary provider is the default provider. If the user has not typed a
146 // keyword, then the primary provider corresponds to the default provider. 156 // keyword, then the primary provider corresponds to the default provider.
147 // 157 //
148 // The value column gives the ranking returned from the various providers. 158 // The value column gives the ranking returned from the various providers.
149 // ++: a series of matches with relevance from n up to (n + max_matches). 159 // ++: a series of matches with relevance from n up to (n + max_matches).
150 // --: relevance score falls off over time (discounted 50 points @ 15 minutes, 160 // --: relevance score falls off over time (discounted 50 points @ 15 minutes,
151 // 450 points @ two weeks) 161 // 450 points @ two weeks)
152 // --: relevance score falls off over two days (discounted 99 points after two 162 // **: relevance score falls off over two days (discounted 99 points after two
153 // days). 163 // days).
164 // *~: Partial matches get a score on a sliding scale from about 575-1125 based
165 // on how many times the URL for the Extension App has been typed and how
166 // many of the letters match.
154 167
155 class AutocompleteController; 168 class AutocompleteController;
156 class AutocompleteControllerDelegate; 169 class AutocompleteControllerDelegate;
157 class AutocompleteInput; 170 class AutocompleteInput;
158 struct AutocompleteMatch; 171 struct AutocompleteMatch;
159 class AutocompleteProvider; 172 class AutocompleteProvider;
160 class AutocompleteResult; 173 class AutocompleteResult;
161 class HistoryContentsProvider; 174 class HistoryContentsProvider;
162 class Profile; 175 class Profile;
163 class SearchProvider; 176 class SearchProvider;
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 AutocompleteInput::Type input_type; 745 AutocompleteInput::Type input_type;
733 // Selected index (if selected) or -1 (AutocompletePopupModel::kNoMatch). 746 // Selected index (if selected) or -1 (AutocompletePopupModel::kNoMatch).
734 size_t selected_index; 747 size_t selected_index;
735 // Inline autocompleted length (if displayed). 748 // Inline autocompleted length (if displayed).
736 size_t inline_autocompleted_length; 749 size_t inline_autocompleted_length;
737 // Result set. 750 // Result set.
738 const AutocompleteResult& result; 751 const AutocompleteResult& result;
739 }; 752 };
740 753
741 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ 754 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698