[safe-browsing] Database full hash matches like prefix match.
[chromium-blink-merge.git] / chrome / browser / autocomplete / history_provider.h
blob3e3f83704fa0906fa22f768cd648e2d4ec023e22
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_HISTORY_PROVIDER_H_
6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_PROVIDER_H_
8 #include "base/compiler_specific.h"
9 #include "chrome/browser/autocomplete/autocomplete_provider.h"
10 #include "chrome/browser/history/in_memory_url_index_types.h"
12 class AutocompleteInput;
13 struct AutocompleteMatch;
15 // This class is a base class for the history autocomplete providers and
16 // provides functions useful to all derived classes.
17 class HistoryProvider : public AutocompleteProvider {
18 public:
19 virtual void DeleteMatch(const AutocompleteMatch& match) OVERRIDE;
21 // Returns true if inline autocompletion should be prevented for URL-like
22 // input. This method returns true if input.prevent_inline_autocomplete()
23 // is true or the input text contains trailing whitespace.
24 static bool PreventInlineAutocomplete(const AutocompleteInput& input);
26 protected:
27 HistoryProvider(AutocompleteProviderListener* listener,
28 Profile* profile,
29 AutocompleteProvider::Type type);
30 virtual ~HistoryProvider();
32 // Finds and removes the match from the current collection of matches and
33 // backing data.
34 void DeleteMatchFromMatches(const AutocompleteMatch& match);
36 // Fill and return an ACMatchClassifications structure given the |matches|
37 // to highlight.
38 static ACMatchClassifications SpansFromTermMatch(
39 const history::TermMatches& matches,
40 size_t text_length,
41 bool is_url);
44 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_PROVIDER_H_