Chromium Code Reviews| 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_AUTOCOMPLETE_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CONTROLLER_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 // sent. | 73 // sent. |
| 74 void Start(const AutocompleteInput& input); | 74 void Start(const AutocompleteInput& input); |
| 75 | 75 |
| 76 // Cancels the current query, ensuring there will be no future notifications | 76 // Cancels the current query, ensuring there will be no future notifications |
| 77 // fired. If new matches have come in since the most recent notification was | 77 // fired. If new matches have come in since the most recent notification was |
| 78 // fired, they will be discarded. | 78 // fired, they will be discarded. |
| 79 // | 79 // |
| 80 // If |clear_result| is true, the controller will also erase the result set. | 80 // If |clear_result| is true, the controller will also erase the result set. |
| 81 void Stop(bool clear_result); | 81 void Stop(bool clear_result); |
| 82 | 82 |
| 83 // Begin asynchronous fetch of zero-suggest suggestions. The |input| should | 83 // Begin asynchronous fetch of suggestions to be shown when the omnibox is |
| 84 // contain current omnibox input, the URL of the page we are on, and | 84 // focused. The |input| should contain current omnibox input, the URL of the |
| 85 // that page's classification. | 85 // page we are on, and that page's classification. |
| 86 void StartZeroSuggest(const AutocompleteInput& input); | 86 void StartOnOmniboxFocus(const AutocompleteInput& input); |
|
Peter Kasting
2014/12/30 21:18:23
Nit: How about this comment and name:
// Called
jif
2014/12/31 19:02:26
Done.
| |
| 87 | 87 |
| 88 // Asks the relevant provider to delete |match|, and ensures observers are | 88 // Asks the relevant provider to delete |match|, and ensures observers are |
| 89 // notified of resulting changes immediately. This should only be called when | 89 // notified of resulting changes immediately. This should only be called when |
| 90 // no query is running. | 90 // no query is running. |
| 91 void DeleteMatch(const AutocompleteMatch& match); | 91 void DeleteMatch(const AutocompleteMatch& match); |
| 92 | 92 |
| 93 // Removes any entries that were copied from the last result. This is used by | 93 // Removes any entries that were copied from the last result. This is used by |
| 94 // the popup to ensure it's not showing an out-of-date query. | 94 // the popup to ensure it's not showing an out-of-date query. |
| 95 void ExpireCopiedEntries(); | 95 void ExpireCopiedEntries(); |
| 96 | 96 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 204 Providers providers_; | 204 Providers providers_; |
| 205 | 205 |
| 206 HistoryURLProvider* history_url_provider_; | 206 HistoryURLProvider* history_url_provider_; |
| 207 | 207 |
| 208 KeywordProvider* keyword_provider_; | 208 KeywordProvider* keyword_provider_; |
| 209 | 209 |
| 210 SearchProvider* search_provider_; | 210 SearchProvider* search_provider_; |
| 211 | 211 |
| 212 ZeroSuggestProvider* zero_suggest_provider_; | 212 ZeroSuggestProvider* zero_suggest_provider_; |
| 213 | 213 |
| 214 // Returns whether |providers_| contains providers that are started when the | |
| 215 // omnibox is focused. | |
| 216 bool has_providers_for_omnibox_focus_; | |
| 217 | |
| 214 // Input passed to Start. | 218 // Input passed to Start. |
| 215 AutocompleteInput input_; | 219 AutocompleteInput input_; |
| 216 | 220 |
| 217 // Data from the autocomplete query. | 221 // Data from the autocomplete query. |
| 218 AutocompleteResult result_; | 222 AutocompleteResult result_; |
| 219 | 223 |
| 220 // The most recent time the default match (inline match) changed. This may | 224 // The most recent time the default match (inline match) changed. This may |
| 221 // be earlier than the most recent keystroke if the recent keystrokes didn't | 225 // be earlier than the most recent keystroke if the recent keystrokes didn't |
| 222 // change the suggested match in the omnibox. (For instance, if | 226 // change the suggested match in the omnibox. (For instance, if |
| 223 // a user typed "mail.goog" and the match https://mail.google.com/ was | 227 // a user typed "mail.goog" and the match https://mail.google.com/ was |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 249 // Are we in Start()? This is used to avoid updating |result_| and sending | 253 // Are we in Start()? This is used to avoid updating |result_| and sending |
| 250 // notifications until Start() has been invoked on all providers. | 254 // notifications until Start() has been invoked on all providers. |
| 251 bool in_start_; | 255 bool in_start_; |
| 252 | 256 |
| 253 TemplateURLService* template_url_service_; | 257 TemplateURLService* template_url_service_; |
| 254 | 258 |
| 255 DISALLOW_COPY_AND_ASSIGN(AutocompleteController); | 259 DISALLOW_COPY_AND_ASSIGN(AutocompleteController); |
| 256 }; | 260 }; |
| 257 | 261 |
| 258 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CONTROLLER_H_ | 262 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CONTROLLER_H_ |
| OLD | NEW |