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_BROWSER_HISTORY_URL_PROVIDER_H_ | 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_HISTORY_URL_PROVIDER_H_ |
6 #define COMPONENTS_OMNIBOX_BROWSER_HISTORY_URL_PROVIDER_H_ | 6 #define COMPONENTS_OMNIBOX_BROWSER_HISTORY_URL_PROVIDER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ref_counted.h" |
16 #include "base/synchronization/cancellation_flag.h" | 17 #include "base/synchronization/cancellation_flag.h" |
17 #include "base/threading/thread_checker.h" | 18 #include "base/threading/thread_checker.h" |
18 #include "components/history/core/browser/history_match.h" | 19 #include "components/history/core/browser/history_match.h" |
19 #include "components/omnibox/browser/autocomplete_input.h" | 20 #include "components/omnibox/browser/autocomplete_input.h" |
20 #include "components/omnibox/browser/history_provider.h" | 21 #include "components/omnibox/browser/history_provider.h" |
21 #include "components/omnibox/browser/omnibox_field_trial.h" | 22 #include "components/omnibox/browser/omnibox_field_trial.h" |
22 #include "components/search_engines/template_url.h" | 23 #include "components/search_engines/template_url.h" |
23 | 24 |
24 class AutocompleteProviderListener; | 25 class AutocompleteProviderListener; |
25 class SearchTermsData; | 26 class SearchTermsData; |
26 | 27 |
27 namespace base { | 28 namespace base { |
28 class MessageLoop; | 29 class SequencedTaskRunner; |
29 } | 30 } |
30 | 31 |
31 namespace history { | 32 namespace history { |
32 class HistoryBackend; | 33 class HistoryBackend; |
33 class URLDatabase; | 34 class URLDatabase; |
34 } | 35 } |
35 | 36 |
36 // How history autocomplete works | 37 // How history autocomplete works |
37 // ============================== | 38 // ============================== |
38 // | 39 // |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 NEITHER, | 101 NEITHER, |
101 }; | 102 }; |
102 | 103 |
103 HistoryURLProviderParams(const AutocompleteInput& input, | 104 HistoryURLProviderParams(const AutocompleteInput& input, |
104 bool trim_http, | 105 bool trim_http, |
105 const AutocompleteMatch& what_you_typed_match, | 106 const AutocompleteMatch& what_you_typed_match, |
106 TemplateURL* default_search_provider, | 107 TemplateURL* default_search_provider, |
107 const SearchTermsData& search_terms_data); | 108 const SearchTermsData& search_terms_data); |
108 ~HistoryURLProviderParams(); | 109 ~HistoryURLProviderParams(); |
109 | 110 |
110 base::MessageLoop* message_loop; | 111 const scoped_refptr<base::SequencedTaskRunner> origin_task_runner; |
111 | 112 |
112 // A copy of the autocomplete input. We need the copy since this object will | 113 // A copy of the autocomplete input. We need the copy since this object will |
113 // live beyond the original query while it runs on the history thread. | 114 // live beyond the original query while it runs on the history thread. |
114 AutocompleteInput input; | 115 AutocompleteInput input; |
115 | 116 |
116 // Should inline autocompletion be disabled? This is initalized from | 117 // Should inline autocompletion be disabled? This is initalized from |
117 // |input.prevent_inline_autocomplete()|, but set to false is the input | 118 // |input.prevent_inline_autocomplete()|, but set to false is the input |
118 // contains trailing white space. | 119 // contains trailing white space. |
119 bool prevent_inline_autocomplete; | 120 bool prevent_inline_autocomplete; |
120 | 121 |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 | 343 |
343 // Params controlling experimental behavior of this provider. | 344 // Params controlling experimental behavior of this provider. |
344 HUPScoringParams scoring_params_; | 345 HUPScoringParams scoring_params_; |
345 | 346 |
346 base::ThreadChecker thread_checker_; | 347 base::ThreadChecker thread_checker_; |
347 | 348 |
348 DISALLOW_COPY_AND_ASSIGN(HistoryURLProvider); | 349 DISALLOW_COPY_AND_ASSIGN(HistoryURLProvider); |
349 }; | 350 }; |
350 | 351 |
351 #endif // COMPONENTS_OMNIBOX_BROWSER_HISTORY_URL_PROVIDER_H_ | 352 #endif // COMPONENTS_OMNIBOX_BROWSER_HISTORY_URL_PROVIDER_H_ |
OLD | NEW |