Chromium Code Reviews| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 | 45 |
| 46 // ShortcutsBackendObserver: | 46 // ShortcutsBackendObserver: |
| 47 void OnShortcutsLoaded() override; | 47 void OnShortcutsLoaded() override; |
| 48 | 48 |
| 49 // Performs the autocomplete matching and scoring. | 49 // Performs the autocomplete matching and scoring. |
| 50 void GetMatches(const AutocompleteInput& input); | 50 void GetMatches(const AutocompleteInput& input); |
| 51 | 51 |
| 52 // Returns an AutocompleteMatch corresponding to |shortcut|. Assigns it | 52 // Returns an AutocompleteMatch corresponding to |shortcut|. Assigns it |
| 53 // |relevance| score in the process, and highlights the description and | 53 // |relevance| score in the process, and highlights the description and |
| 54 // contents against |input|, which should be the lower-cased version of | 54 // contents against |input|, which should be the lower-cased version of |
| 55 // the user's input. |input| and |fixed_up_input_text| are used to decide | 55 // the user's input. |input|, |fixed_up_input_text|, and |words| are used |
|
Peter Kasting
2015/06/06 01:31:23
Nit: Extra space
Mark P
2015/06/09 19:29:38
Now obsolete.
| |
| 56 // what can be inlined. | 56 // to decide what can be inlined. |
|
Peter Kasting
2015/06/06 01:31:23
Nit: You might want to just give one sentence on h
Mark P
2015/06/09 19:29:38
Now (mostly) obsolete, or at least not relevant to
| |
| 57 AutocompleteMatch ShortcutToACMatch( | 57 AutocompleteMatch ShortcutToACMatch( |
| 58 const ShortcutsDatabase::Shortcut& shortcut, | 58 const ShortcutsDatabase::Shortcut& shortcut, |
| 59 int relevance, | 59 int relevance, |
| 60 const AutocompleteInput& input, | 60 const AutocompleteInput& input, |
| 61 const base::string16& fixed_up_input_text); | 61 const base::string16& fixed_up_input_text, |
| 62 const std::vector<base::string16>& words); | |
|
Peter Kasting
2015/06/06 01:31:23
Nit: I kinda feel like ComputeStrippedDestinationU
Mark P
2015/06/09 19:29:38
Now obsolete.
| |
| 62 | 63 |
| 63 // Returns a map mapping characters to groups of words from |text| that start | 64 // Returns a map mapping characters to groups of words from |text| that start |
| 64 // with those characters, ordered lexicographically descending so that longer | 65 // with those characters, ordered lexicographically descending so that longer |
| 65 // words appear before their prefixes (if any) within a particular | 66 // words appear before their prefixes (if any) within a particular |
| 66 // equal_range(). | 67 // equal_range(). |
| 67 static WordMap CreateWordMapForString(const base::string16& text); | 68 static WordMap CreateWordMapForString(const base::string16& text); |
| 68 | 69 |
| 69 // Given |text| and a corresponding base set of classifications | 70 // Given |text| and a corresponding base set of classifications |
| 70 // |original_class|, adds ACMatchClassification::MATCH markers for all | 71 // |original_class|, adds ACMatchClassification::MATCH markers for all |
| 71 // instances of the words from |find_words| within |text| and returns the | 72 // instances of the words from |find_words| within |text| and returns the |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 | 105 |
| 105 // The default max relevance unless overridden by a field trial. | 106 // The default max relevance unless overridden by a field trial. |
| 106 static const int kShortcutsProviderDefaultMaxRelevance; | 107 static const int kShortcutsProviderDefaultMaxRelevance; |
| 107 | 108 |
| 108 Profile* profile_; | 109 Profile* profile_; |
| 109 std::string languages_; | 110 std::string languages_; |
| 110 bool initialized_; | 111 bool initialized_; |
| 111 }; | 112 }; |
| 112 | 113 |
| 113 #endif // CHROME_BROWSER_AUTOCOMPLETE_SHORTCUTS_PROVIDER_H_ | 114 #endif // CHROME_BROWSER_AUTOCOMPLETE_SHORTCUTS_PROVIDER_H_ |
| OLD | NEW |