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 COMPONENTS_OMNIBOX_HISTORY_QUICK_PROVIDER_H_ | 5 #ifndef COMPONENTS_OMNIBOX_HISTORY_QUICK_PROVIDER_H_ |
6 #define COMPONENTS_OMNIBOX_HISTORY_QUICK_PROVIDER_H_ | 6 #define COMPONENTS_OMNIBOX_HISTORY_QUICK_PROVIDER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "components/history/core/browser/history_types.h" | 12 #include "components/history/core/browser/history_types.h" |
13 #include "components/omnibox/autocomplete_input.h" | 13 #include "components/omnibox/autocomplete_input.h" |
14 #include "components/omnibox/autocomplete_match.h" | 14 #include "components/omnibox/autocomplete_match.h" |
15 #include "components/omnibox/history_provider.h" | 15 #include "components/omnibox/history_provider.h" |
16 #include "components/omnibox/in_memory_url_index.h" | 16 #include "components/omnibox/in_memory_url_index.h" |
17 | 17 |
18 struct ScoredHistoryMatch; | 18 struct ScoredHistoryMatch; |
19 | 19 |
20 // This class is an autocomplete provider (a pseudo-internal component of | 20 // This class is an autocomplete provider (a pseudo-internal component of |
21 // the history system) which quickly (and synchronously) provides matching | 21 // the history system) which quickly (and synchronously) provides matching |
22 // results from recently or frequently visited sites in the profile's | 22 // results from recently or frequently visited sites in the profile's |
23 // history. | 23 // history. |
24 class HistoryQuickProvider : public HistoryProvider { | 24 class HistoryQuickProvider : public HistoryProvider { |
25 public: | 25 public: |
26 HistoryQuickProvider(AutocompleteProviderClient* client, | 26 explicit HistoryQuickProvider(AutocompleteProviderClient* client); |
27 InMemoryURLIndex* in_memory_url_index); | |
28 | 27 |
29 // AutocompleteProvider. |minimal_changes| is ignored since there is no asynch | 28 // AutocompleteProvider. |minimal_changes| is ignored since there is no asynch |
30 // completion performed. | 29 // completion performed. |
31 void Start(const AutocompleteInput& input, bool minimal_changes) override; | 30 void Start(const AutocompleteInput& input, bool minimal_changes) override; |
32 | 31 |
33 // Disable this provider. For unit testing purposes only. This is required | 32 // Disable this provider. For unit testing purposes only. This is required |
34 // because this provider is closely associated with the HistoryURLProvider | 33 // because this provider is closely associated with the HistoryURLProvider |
35 // and in order to properly test the latter the HistoryQuickProvider must | 34 // and in order to properly test the latter the HistoryQuickProvider must |
36 // be disabled. | 35 // be disabled. |
37 // TODO(mrossetti): Eliminate this once the HUP has been refactored. | 36 // TODO(mrossetti): Eliminate this once the HUP has been refactored. |
(...skipping 18 matching lines...) Expand all Loading... |
56 std::string languages_; | 55 std::string languages_; |
57 InMemoryURLIndex* in_memory_url_index_; // Not owned by this class. | 56 InMemoryURLIndex* in_memory_url_index_; // Not owned by this class. |
58 | 57 |
59 // This provider is disabled when true. | 58 // This provider is disabled when true. |
60 static bool disabled_; | 59 static bool disabled_; |
61 | 60 |
62 DISALLOW_COPY_AND_ASSIGN(HistoryQuickProvider); | 61 DISALLOW_COPY_AND_ASSIGN(HistoryQuickProvider); |
63 }; | 62 }; |
64 | 63 |
65 #endif // COMPONENTS_OMNIBOX_HISTORY_QUICK_PROVIDER_H_ | 64 #endif // COMPONENTS_OMNIBOX_HISTORY_QUICK_PROVIDER_H_ |
OLD | NEW |