Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: chrome/browser/autocomplete/history_provider.h

Issue 388203002: Remove listener_ from AutocompleteProvider base class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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" 10 #include "chrome/browser/history/in_memory_url_index_types.h"
11 11
12 class AutocompleteInput; 12 class AutocompleteInput;
13 class Profile; 13 class Profile;
14 struct AutocompleteMatch; 14 struct AutocompleteMatch;
15 15
16 // This class is a base class for the history autocomplete providers and 16 // This class is a base class for the history autocomplete providers and
17 // provides functions useful to all derived classes. 17 // provides functions useful to all derived classes.
18 class HistoryProvider : public AutocompleteProvider { 18 class HistoryProvider : public AutocompleteProvider {
19 public: 19 public:
20 virtual void DeleteMatch(const AutocompleteMatch& match) OVERRIDE; 20 virtual void DeleteMatch(const AutocompleteMatch& match) OVERRIDE;
21 21
22 // Returns true if inline autocompletion should be prevented for URL-like 22 // Returns true if inline autocompletion should be prevented for URL-like
23 // input. This method returns true if input.prevent_inline_autocomplete() 23 // input. This method returns true if input.prevent_inline_autocomplete()
24 // is true or the input text contains trailing whitespace. 24 // is true or the input text contains trailing whitespace.
25 static bool PreventInlineAutocomplete(const AutocompleteInput& input); 25 static bool PreventInlineAutocomplete(const AutocompleteInput& input);
26 26
27 protected: 27 protected:
28 HistoryProvider(AutocompleteProviderListener* listener, 28 HistoryProvider(Profile* profile, AutocompleteProvider::Type type);
29 Profile* profile,
30 AutocompleteProvider::Type type);
31 virtual ~HistoryProvider(); 29 virtual ~HistoryProvider();
32 30
33 // Finds and removes the match from the current collection of matches and 31 // Finds and removes the match from the current collection of matches and
34 // backing data. 32 // backing data.
35 void DeleteMatchFromMatches(const AutocompleteMatch& match); 33 void DeleteMatchFromMatches(const AutocompleteMatch& match);
36 34
37 // Fill and return an ACMatchClassifications structure given the |matches| 35 // Fill and return an ACMatchClassifications structure given the |matches|
38 // to highlight. 36 // to highlight.
39 static ACMatchClassifications SpansFromTermMatch( 37 static ACMatchClassifications SpansFromTermMatch(
40 const history::TermMatches& matches, 38 const history::TermMatches& matches,
41 size_t text_length, 39 size_t text_length,
42 bool is_url); 40 bool is_url);
43 41
44 Profile* profile_; 42 Profile* profile_;
45 }; 43 };
46 44
47 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_PROVIDER_H_ 45 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_PROVIDER_H_
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/builtin_provider_unittest.cc ('k') | chrome/browser/autocomplete/history_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698