| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // Historically the relevance for each column added up to 100, then scores | 38 // Historically the relevance for each column added up to 100, then scores |
| 39 // were from 1-100. Both have proved a bit painful, and will be changed going | 39 // were from 1-100. Both have proved a bit painful, and will be changed going |
| 40 // forward. The important part is that higher relevance scores are more | 40 // forward. The important part is that higher relevance scores are more |
| 41 // important than lower relevance scores. The relevance scores and class | 41 // important than lower relevance scores. The relevance scores and class |
| 42 // providing the result are as follows: | 42 // providing the result are as follows: |
| 43 // | 43 // |
| 44 // UNKNOWN input type: | 44 // UNKNOWN input type: |
| 45 // --------------------------------------------------------------------|----- | 45 // --------------------------------------------------------------------|----- |
| 46 // Keyword (non-substituting or in keyword UI mode, exact match) | 1500 | 46 // Keyword (non-substituting or in keyword UI mode, exact match) | 1500 |
| 47 // HistoryURL (exact or inline autocomplete match) | 1400 | 47 // HistoryURL (exact or inline autocomplete match) | 1400 |
| 48 // Search (what you typed) | 1300 | 48 // Search Primary Provider (what you typed) | 1300 |
| 49 // HistoryURL (what you typed) | 1200 | 49 // HistoryURL (what you typed) | 1200 |
| 50 // Keyword (substituting, exact match) | 1100 | 50 // Keyword (substituting, exact match) | 1100 |
| 51 // Search (past query in history) | 1050-- | 51 // Search Primary Provider (past query in history) | 1050-- |
| 52 // HistoryContents (any match in title of starred page) | 1000++ | 52 // HistoryContents (any match in title of starred page) | 1000++ |
| 53 // HistoryURL (inexact match) | 900++ | 53 // HistoryURL (inexact match) | 900++ |
| 54 // Search (navigational suggestion) | 800++ | 54 // Search Primary Provider (navigational suggestion) | 800++ |
| 55 // HistoryContents (any match in title of nonstarred page) | 700++ | 55 // HistoryContents (any match in title of nonstarred page) | 700++ |
| 56 // Search (suggestion) | 600++ | 56 // Search Primary Provider (suggestion) | 600++ |
| 57 // HistoryContents (any match in body of starred page) | 550++ | 57 // HistoryContents (any match in body of starred page) | 550++ |
| 58 // HistoryContents (any match in body of nonstarred page) | 500++ | 58 // HistoryContents (any match in body of nonstarred page) | 500++ |
| 59 // Keyword (inexact match) | 450 | 59 // Keyword (inexact match) | 450 |
| 60 // Search Secondary Provider (what you typed) | 250 |
| 61 // Search Secondary Provider (past query in history) | 200-- |
| 62 // Search Secondary Provider (navigational suggestion) | 150++ |
| 63 // Search Secondary Provider (suggestion) | 100++ |
| 60 // | 64 // |
| 61 // REQUESTED_URL input type: | 65 // REQUESTED_URL input type: |
| 62 // --------------------------------------------------------------------|----- | 66 // --------------------------------------------------------------------|----- |
| 63 // Keyword (non-substituting or in keyword UI mode, exact match) | 1500 | 67 // Keyword (non-substituting or in keyword UI mode, exact match) | 1500 |
| 64 // HistoryURL (exact or inline autocomplete match) | 1400 | 68 // HistoryURL (exact or inline autocomplete match) | 1400 |
| 65 // HistoryURL (what you typed) | 1300 | 69 // HistoryURL (what you typed) | 1300 |
| 66 // Search (what you typed) | 1200 | 70 // Search Primary Provider (what you typed) | 1200 |
| 67 // Keyword (substituting, exact match) | 1100 | 71 // Keyword (substituting, exact match) | 1100 |
| 68 // Search (past query in history) | 1050-- | 72 // Search Primary Provider (past query in history) | 1050-- |
| 69 // HistoryContents (any match in title of starred page) | 1000++ | 73 // HistoryContents (any match in title of starred page) | 1000++ |
| 70 // HistoryURL (inexact match) | 900++ | 74 // HistoryURL (inexact match) | 900++ |
| 71 // Search (navigational suggestion) | 800++ | 75 // Search Primary Provider (navigational suggestion) | 800++ |
| 72 // HistoryContents (any match in title of nonstarred page) | 700++ | 76 // HistoryContents (any match in title of nonstarred page) | 700++ |
| 73 // Search (suggestion) | 600++ | 77 // Search Primary Provider (suggestion) | 600++ |
| 74 // HistoryContents (any match in body of starred page) | 550++ | 78 // HistoryContents (any match in body of starred page) | 550++ |
| 75 // HistoryContents (any match in body of nonstarred page) | 500++ | 79 // HistoryContents (any match in body of nonstarred page) | 500++ |
| 76 // Keyword (inexact match) | 450 | 80 // Keyword (inexact match) | 450 |
| 81 // Search Secondary Provider (what you typed) | 250 |
| 82 // Search Secondary Provider (past query in history) | 200-- |
| 83 // Search Secondary Provider (navigational suggestion) | 150++ |
| 84 // Search Secondary Provider (suggestion) | 100++ |
| 77 // | 85 // |
| 78 // URL input type: | 86 // URL input type: |
| 79 // --------------------------------------------------------------------|----- | 87 // --------------------------------------------------------------------|----- |
| 80 // Keyword (non-substituting or in keyword UI mode, exact match) | 1500 | 88 // Keyword (non-substituting or in keyword UI mode, exact match) | 1500 |
| 81 // HistoryURL (exact or inline autocomplete match) | 1400 | 89 // HistoryURL (exact or inline autocomplete match) | 1400 |
| 82 // HistoryURL (what you typed) | 1200 | 90 // HistoryURL (what you typed) | 1200 |
| 83 // Keyword (substituting, exact match) | 1100 | 91 // Keyword (substituting, exact match) | 1100 |
| 84 // HistoryURL (inexact match) | 900++ | 92 // HistoryURL (inexact match) | 900++ |
| 85 // Search (what you typed) | 850 | 93 // Search Primary Provider (what you typed) | 850 |
| 86 // Search (navigational suggestion) | 800++ | 94 // Search Primary Provider (navigational suggestion) | 800++ |
| 87 // Search (past query in history) | 750-- | 95 // Search Primary Provider (past query in history) | 750-- |
| 88 // Keyword (inexact match) | 700 | 96 // Keyword (inexact match) | 700 |
| 89 // Search (suggestion) | 300++ | 97 // Search Primary Provider (suggestion) | 300++ |
| 98 // Search Secondary Provider (what you typed) | 250 |
| 99 // Search Secondary Provider (past query in history) | 200-- |
| 100 // Search Secondary Provider (navigational suggestion) | 150++ |
| 101 // Search Secondary Provider (suggestion) | 100++ |
| 90 // | 102 // |
| 91 // QUERY input type: | 103 // QUERY input type: |
| 92 // --------------------------------------------------------------------|----- | 104 // --------------------------------------------------------------------|----- |
| 93 // Keyword (non-substituting or in keyword UI mode, exact match) | 1500 | 105 // Keyword (non-substituting or in keyword UI mode, exact match) | 1500 |
| 94 // Keyword (substituting, exact match) | 1400 | 106 // Keyword (substituting, exact match) | 1400 |
| 95 // Search (what you typed) | 1300 | 107 // Search Primary Provider (what you typed) | 1300 |
| 96 // Search (past query in history) | 1250-- | 108 // Search Primary Provider (past query in history) | 1250-- |
| 97 // HistoryContents (any match in title of starred page) | 1200++ | 109 // HistoryContents (any match in title of starred page) | 1200++ |
| 98 // Search (navigational suggestion) | 1000++ | 110 // Search Primary Provider (navigational suggestion) | 1000++ |
| 99 // HistoryContents (any match in title of nonstarred page) | 900++ | 111 // HistoryContents (any match in title of nonstarred page) | 900++ |
| 100 // Search (suggestion) | 800++ | 112 // Search Primary Provider (suggestion) | 800++ |
| 101 // HistoryContents (any match in body of starred page) | 750++ | 113 // HistoryContents (any match in body of starred page) | 750++ |
| 102 // HistoryContents (any match in body of nonstarred page) | 700++ | 114 // HistoryContents (any match in body of nonstarred page) | 700++ |
| 103 // Keyword (inexact match) | 650 | 115 // Keyword (inexact match) | 650 |
| 116 // Search Secondary Provider (what you typed) | 250 |
| 117 // Search Secondary Provider (past query in history) | 200-- |
| 118 // Search Secondary Provider (navigational suggestion) | 150++ |
| 119 // Search Secondary Provider (suggestion) | 100++ |
| 104 // | 120 // |
| 105 // FORCED_QUERY input type: | 121 // FORCED_QUERY input type: |
| 106 // --------------------------------------------------------------------|----- | 122 // --------------------------------------------------------------------|----- |
| 107 // Search (what you typed) | 1500 | 123 // Search Primary Provider (what you typed) | 1500 |
| 108 // Search (past query in history) | 1250-- | 124 // Search Primary Provider (past query in history) | 1250-- |
| 109 // HistoryContents (any match in title of starred page) | 1200++ | 125 // HistoryContents (any match in title of starred page) | 1200++ |
| 110 // Search (navigational suggestion) | 1000++ | 126 // Search Primary Provider (navigational suggestion) | 1000++ |
| 111 // HistoryContents (any match in title of nonstarred page) | 900++ | 127 // HistoryContents (any match in title of nonstarred page) | 900++ |
| 112 // Search (suggestion) | 800++ | 128 // Search Primary Provider (suggestion) | 800++ |
| 113 // HistoryContents (any match in body of starred page) | 750++ | 129 // HistoryContents (any match in body of starred page) | 750++ |
| 114 // HistoryContents (any match in body of nonstarred page) | 700++ | 130 // HistoryContents (any match in body of nonstarred page) | 700++ |
| 115 // | 131 // |
| 116 // (A search keyword is a keyword with a replacement string; a bookmark keyword | 132 // (A search keyword is a keyword with a replacement string; a bookmark keyword |
| 117 // is a keyword with no replacement string, that is, a shortcut for a URL.) | 133 // is a keyword with no replacement string, that is, a shortcut for a URL.) |
| 118 // | 134 // |
| 135 // There are two possible providers for search suggestions. If the user has |
| 136 // typed a keyword, then the primary provider is the keyword provider and the |
| 137 // secondary provider is the default provider. If the user has not typed a |
| 138 // keyword, then the primary provider corresponds to the default provider. |
| 139 // |
| 119 // The value column gives the ranking returned from the various providers. | 140 // The value column gives the ranking returned from the various providers. |
| 120 // ++: a series of results with relevance from n up to (n + max_matches). | 141 // ++: a series of results with relevance from n up to (n + max_matches). |
| 121 // --: relevance score falls off over time (discounted 50 points @ 15 minutes, | 142 // --: relevance score falls off over time (discounted 50 points @ 15 minutes, |
| 122 // 450 points @ two weeks) | 143 // 450 points @ two weeks) |
| 123 | 144 |
| 124 class AutocompleteInput; | 145 class AutocompleteInput; |
| 125 struct AutocompleteMatch; | 146 struct AutocompleteMatch; |
| 126 class AutocompleteProvider; | 147 class AutocompleteProvider; |
| 127 class AutocompleteResult; | 148 class AutocompleteResult; |
| 128 class AutocompleteController; | 149 class AutocompleteController; |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 AutocompleteInput::Type input_type; | 824 AutocompleteInput::Type input_type; |
| 804 // Selected index (if selected) or -1 (AutocompletePopupModel::kNoMatch). | 825 // Selected index (if selected) or -1 (AutocompletePopupModel::kNoMatch). |
| 805 size_t selected_index; | 826 size_t selected_index; |
| 806 // Inline autocompleted length (if displayed). | 827 // Inline autocompleted length (if displayed). |
| 807 size_t inline_autocompleted_length; | 828 size_t inline_autocompleted_length; |
| 808 // Result set. | 829 // Result set. |
| 809 const AutocompleteResult& result; | 830 const AutocompleteResult& result; |
| 810 }; | 831 }; |
| 811 | 832 |
| 812 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ | 833 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ |
| OLD | NEW |