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_HISTORY_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_HISTORY_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_PROVIDER_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_PROVIDER_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "chrome/browser/autocomplete/autocomplete_provider.h" | 9 #include "chrome/browser/autocomplete/autocomplete_provider.h" |
| 10 #include "chrome/browser/history/in_memory_url_index_types.h" | |
|
Peter Kasting
2013/11/23 02:15:36
Nit: Forward-declare TermMatches instead of #inclu
Mark P
2013/11/25 19:59:16
I tried. I could not manage to forward declare a
| |
| 10 | 11 |
| 11 class AutocompleteInput; | 12 class AutocompleteInput; |
| 12 struct AutocompleteMatch; | 13 struct AutocompleteMatch; |
| 13 | 14 |
| 14 // This class is a base class for the history autocomplete providers and | 15 // This class is a base class for the history autocomplete providers and |
| 15 // provides functions useful to all derived classes. | 16 // provides functions useful to all derived classes. |
| 16 class HistoryProvider : public AutocompleteProvider { | 17 class HistoryProvider : public AutocompleteProvider { |
| 17 public: | 18 public: |
| 18 virtual void DeleteMatch(const AutocompleteMatch& match) OVERRIDE; | 19 virtual void DeleteMatch(const AutocompleteMatch& match) OVERRIDE; |
| 19 | 20 |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 46 // NOTE: For a view-source: URL, this will trim from after "view-source:" and | 47 // NOTE: For a view-source: URL, this will trim from after "view-source:" and |
| 47 // return 0. | 48 // return 0. |
| 48 static size_t TrimHttpPrefix(string16* url); | 49 static size_t TrimHttpPrefix(string16* url); |
| 49 | 50 |
| 50 // Returns true if inline autocompletion should be prevented. Use this instead | 51 // Returns true if inline autocompletion should be prevented. Use this instead |
| 51 // of |input.prevent_inline_autocomplete| if the input is passed through | 52 // of |input.prevent_inline_autocomplete| if the input is passed through |
| 52 // FixupUserInput(). This method returns true if | 53 // FixupUserInput(). This method returns true if |
| 53 // |input.prevent_inline_autocomplete()| is true or the input text contains | 54 // |input.prevent_inline_autocomplete()| is true or the input text contains |
| 54 // trailing whitespace. | 55 // trailing whitespace. |
| 55 bool PreventInlineAutocomplete(const AutocompleteInput& input); | 56 bool PreventInlineAutocomplete(const AutocompleteInput& input); |
| 57 | |
| 58 // Fill and return an ACMatchClassifications structure given the term | |
|
Mark P
2013/11/22 02:26:32
This was moved here from history_quick_provider.h.
| |
| 59 // matches (|matches|) to highlight where terms were found. | |
|
Peter Kasting
2013/11/23 02:15:36
Nit: "...given the |matches| to highlight." is pro
Mark P
2013/11/25 19:59:16
Done.
| |
| 60 static ACMatchClassifications SpansFromTermMatch( | |
| 61 const history::TermMatches& matches, | |
| 62 size_t text_length, | |
| 63 bool is_url); | |
| 56 }; | 64 }; |
| 57 | 65 |
| 58 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_PROVIDER_H_ | 66 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_PROVIDER_H_ |
| OLD | NEW |