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 17 matching lines...) Expand all Loading... |
28 class HistoryQuickProvider : public HistoryProvider { | 28 class HistoryQuickProvider : public HistoryProvider { |
29 public: | 29 public: |
30 HistoryQuickProvider(AutocompleteProviderListener* listener, | 30 HistoryQuickProvider(AutocompleteProviderListener* listener, |
31 Profile* profile); | 31 Profile* profile); |
32 | 32 |
33 // AutocompleteProvider. |minimal_changes| is ignored since there is no asynch | 33 // AutocompleteProvider. |minimal_changes| is ignored since there is no asynch |
34 // completion performed. | 34 // completion performed. |
35 virtual void Start(const AutocompleteInput& input, | 35 virtual void Start(const AutocompleteInput& input, |
36 bool minimal_changes) OVERRIDE; | 36 bool minimal_changes) OVERRIDE; |
37 | 37 |
38 virtual void DeleteMatch(const AutocompleteMatch& match) OVERRIDE; | |
39 | |
40 // Disable this provider. For unit testing purposes only. This is required | 38 // Disable this provider. For unit testing purposes only. This is required |
41 // because this provider is closely associated with the HistoryURLProvider | 39 // because this provider is closely associated with the HistoryURLProvider |
42 // and in order to properly test the latter the HistoryQuickProvider must | 40 // and in order to properly test the latter the HistoryQuickProvider must |
43 // be disabled. | 41 // be disabled. |
44 // TODO(mrossetti): Eliminate this once the HUP has been refactored. | 42 // TODO(mrossetti): Eliminate this once the HUP has been refactored. |
45 static void set_disabled(bool disabled) { disabled_ = disabled; } | 43 static void set_disabled(bool disabled) { disabled_ = disabled; } |
46 | 44 |
47 private: | 45 private: |
48 friend class HistoryQuickProviderTest; | 46 friend class HistoryQuickProviderTest; |
49 FRIEND_TEST_ALL_PREFIXES(HistoryQuickProviderTest, Spans); | 47 FRIEND_TEST_ALL_PREFIXES(HistoryQuickProviderTest, Spans); |
(...skipping 24 matching lines...) Expand all Loading... |
74 // Only used for testing. | 72 // Only used for testing. |
75 scoped_ptr<history::InMemoryURLIndex> index_for_testing_; | 73 scoped_ptr<history::InMemoryURLIndex> index_for_testing_; |
76 | 74 |
77 // This provider is disabled when true. | 75 // This provider is disabled when true. |
78 static bool disabled_; | 76 static bool disabled_; |
79 | 77 |
80 DISALLOW_COPY_AND_ASSIGN(HistoryQuickProvider); | 78 DISALLOW_COPY_AND_ASSIGN(HistoryQuickProvider); |
81 }; | 79 }; |
82 | 80 |
83 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_ | 81 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_ |
OLD | NEW |