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_AUTOCOMPLETE_CONTROLLER_H_ | 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_CONTROLLER_H_ |
6 #define COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_CONTROLLER_H_ | 6 #define COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_CONTROLLER_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
9 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
10 #include "base/macros.h" | 12 #include "base/macros.h" |
11 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
12 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
13 #include "base/time/time.h" | 15 #include "base/time/time.h" |
14 #include "base/timer/timer.h" | 16 #include "base/timer/timer.h" |
15 #include "components/omnibox/browser/autocomplete_input.h" | 17 #include "components/omnibox/browser/autocomplete_input.h" |
16 #include "components/omnibox/browser/autocomplete_provider.h" | 18 #include "components/omnibox/browser/autocomplete_provider.h" |
17 #include "components/omnibox/browser/autocomplete_provider_client.h" | 19 #include "components/omnibox/browser/autocomplete_provider_client.h" |
18 #include "components/omnibox/browser/autocomplete_provider_listener.h" | 20 #include "components/omnibox/browser/autocomplete_provider_listener.h" |
19 #include "components/omnibox/browser/autocomplete_result.h" | 21 #include "components/omnibox/browser/autocomplete_result.h" |
20 | 22 |
21 class AutocompleteControllerDelegate; | 23 class AutocompleteControllerDelegate; |
| 24 class ClipboardRecentContent; |
22 class HistoryURLProvider; | 25 class HistoryURLProvider; |
23 class KeywordProvider; | 26 class KeywordProvider; |
24 class SearchProvider; | 27 class SearchProvider; |
25 class TemplateURLService; | 28 class TemplateURLService; |
26 class ZeroSuggestProvider; | 29 class ZeroSuggestProvider; |
27 | 30 |
28 // The AutocompleteController is the center of the autocomplete system. A | 31 // The AutocompleteController is the center of the autocomplete system. A |
29 // class creates an instance of the controller, which in turn creates a set of | 32 // class creates an instance of the controller, which in turn creates a set of |
30 // AutocompleteProviders to serve it. The owning class can ask the controller | 33 // AutocompleteProviders to serve it. The owning class can ask the controller |
31 // to Start() a query; the controller in turn passes this call down to the | 34 // to Start() a query; the controller in turn passes this call down to the |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 Providers providers_; | 202 Providers providers_; |
200 | 203 |
201 HistoryURLProvider* history_url_provider_; | 204 HistoryURLProvider* history_url_provider_; |
202 | 205 |
203 KeywordProvider* keyword_provider_; | 206 KeywordProvider* keyword_provider_; |
204 | 207 |
205 SearchProvider* search_provider_; | 208 SearchProvider* search_provider_; |
206 | 209 |
207 ZeroSuggestProvider* zero_suggest_provider_; | 210 ZeroSuggestProvider* zero_suggest_provider_; |
208 | 211 |
| 212 // Used to build the ClipboardURLProvider. |
| 213 std::unique_ptr<ClipboardRecentContent> clipboard_recent_content_; |
| 214 |
209 // Input passed to Start. | 215 // Input passed to Start. |
210 AutocompleteInput input_; | 216 AutocompleteInput input_; |
211 | 217 |
212 // Data from the autocomplete query. | 218 // Data from the autocomplete query. |
213 AutocompleteResult result_; | 219 AutocompleteResult result_; |
214 | 220 |
215 // The most recent time the default match (inline match) changed. This may | 221 // The most recent time the default match (inline match) changed. This may |
216 // be earlier than the most recent keystroke if the recent keystrokes didn't | 222 // be earlier than the most recent keystroke if the recent keystrokes didn't |
217 // change the suggested match in the omnibox. (For instance, if | 223 // change the suggested match in the omnibox. (For instance, if |
218 // a user typed "mail.goog" and the match https://mail.google.com/ was | 224 // a user typed "mail.goog" and the match https://mail.google.com/ was |
(...skipping 25 matching lines...) Expand all Loading... |
244 // Are we in Start()? This is used to avoid updating |result_| and sending | 250 // Are we in Start()? This is used to avoid updating |result_| and sending |
245 // notifications until Start() has been invoked on all providers. | 251 // notifications until Start() has been invoked on all providers. |
246 bool in_start_; | 252 bool in_start_; |
247 | 253 |
248 TemplateURLService* template_url_service_; | 254 TemplateURLService* template_url_service_; |
249 | 255 |
250 DISALLOW_COPY_AND_ASSIGN(AutocompleteController); | 256 DISALLOW_COPY_AND_ASSIGN(AutocompleteController); |
251 }; | 257 }; |
252 | 258 |
253 #endif // COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_CONTROLLER_H_ | 259 #endif // COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_CONTROLLER_H_ |
OLD | NEW |