| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SHORTCUTS_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_SHORTCUTS_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_AUTOCOMPLETE_SHORTCUTS_PROVIDER_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_SHORTCUTS_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 const ACMatchClassifications& original_class); | 89 const ACMatchClassifications& original_class); |
| 90 | 90 |
| 91 // Returns iterator to first item in |shortcuts_map_| matching |keyword|. | 91 // Returns iterator to first item in |shortcuts_map_| matching |keyword|. |
| 92 // Returns shortcuts_map_.end() if there are no matches. | 92 // Returns shortcuts_map_.end() if there are no matches. |
| 93 history::ShortcutsBackend::ShortcutMap::const_iterator FindFirstMatch( | 93 history::ShortcutsBackend::ShortcutMap::const_iterator FindFirstMatch( |
| 94 const string16& keyword, | 94 const string16& keyword, |
| 95 history::ShortcutsBackend* backend); | 95 history::ShortcutsBackend* backend); |
| 96 | 96 |
| 97 int CalculateScore( | 97 int CalculateScore( |
| 98 const string16& terms, | 98 const string16& terms, |
| 99 const history::ShortcutsBackend::Shortcut& shortcut); | 99 const history::ShortcutsBackend::Shortcut& shortcut, |
| 100 int max_relevance); |
| 100 | 101 |
| 101 std::string languages_; | 102 std::string languages_; |
| 102 bool initialized_; | 103 bool initialized_; |
| 103 | |
| 104 // The maximum relevance that can be assigned in CalculateScore(). | |
| 105 // Note that if the final assigned relevance is at least | |
| 106 // AutocompleteResult::kLowestDefaultScore, the relevance will be | |
| 107 // demoted to less than that number because ShortcutsProvider isn't | |
| 108 // allowed to inline. | |
| 109 int max_relevance_; | |
| 110 }; | 104 }; |
| 111 | 105 |
| 112 #endif // CHROME_BROWSER_AUTOCOMPLETE_SHORTCUTS_PROVIDER_H_ | 106 #endif // CHROME_BROWSER_AUTOCOMPLETE_SHORTCUTS_PROVIDER_H_ |
| OLD | NEW |