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_QUICK_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_ |
6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 // This class is an autocomplete provider (a pseudo-internal component of | 25 // This class is an autocomplete provider (a pseudo-internal component of |
26 // the history system) which quickly (and synchronously) provides matching | 26 // the history system) which quickly (and synchronously) provides matching |
27 // results from recently or frequently visited sites in the profile's | 27 // results from recently or frequently visited sites in the profile's |
28 // history. | 28 // history. |
29 class HistoryQuickProvider : public HistoryProvider { | 29 class HistoryQuickProvider : public HistoryProvider { |
30 public: | 30 public: |
31 HistoryQuickProvider(AutocompleteProviderListener* listener, | 31 HistoryQuickProvider(AutocompleteProviderListener* listener, |
32 Profile* profile); | 32 Profile* profile); |
33 | 33 |
34 // AutocompleteProvider. |minimal_changes| is ignored since there is no asynch | 34 // AutocompleteProvider. |
35 // completion performed. | |
36 virtual void Start(const AutocompleteInput& input, | 35 virtual void Start(const AutocompleteInput& input, |
37 bool minimal_changes) OVERRIDE; | 36 bool minimal_changes) OVERRIDE; |
38 | 37 |
39 virtual void DeleteMatch(const AutocompleteMatch& match) OVERRIDE; | 38 virtual void DeleteMatch(const AutocompleteMatch& match) OVERRIDE; |
40 | 39 |
41 // Disable this provider. For unit testing purposes only. This is required | 40 // Disable this provider. For unit testing purposes only. This is required |
42 // because this provider is closely associated with the HistoryURLProvider | 41 // because this provider is closely associated with the HistoryURLProvider |
43 // and in order to properly test the latter the HistoryQuickProvider must | 42 // and in order to properly test the latter the HistoryQuickProvider must |
44 // be disabled. | 43 // be disabled. |
45 // TODO(mrossetti): Eliminate this once the HUP has been refactored. | 44 // TODO(mrossetti): Eliminate this once the HUP has been refactored. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // Only used for testing. | 99 // Only used for testing. |
101 scoped_ptr<history::InMemoryURLIndex> index_for_testing_; | 100 scoped_ptr<history::InMemoryURLIndex> index_for_testing_; |
102 | 101 |
103 // This provider is disabled when true. | 102 // This provider is disabled when true. |
104 static bool disabled_; | 103 static bool disabled_; |
105 | 104 |
106 DISALLOW_COPY_AND_ASSIGN(HistoryQuickProvider); | 105 DISALLOW_COPY_AND_ASSIGN(HistoryQuickProvider); |
107 }; | 106 }; |
108 | 107 |
109 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_ | 108 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_ |
OLD | NEW |