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 // Called when the omnibox is focused while no existing user input is in |
84 // contain current omnibox input, the URL of the page we are on, and | 84 // progress. This is used to trigger any providers which want to provide |
85 // that page's classification. | 85 // matches in response to focus. See |
86 void StartZeroSuggest(const AutocompleteInput& input); | 86 // AutocompleteProvider::ProvidesMatchesOnOmniboxFocus(). |
| 87 void OnOmniboxFocused(const AutocompleteInput& input); |
87 | 88 |
88 // Asks the relevant provider to delete |match|, and ensures observers are | 89 // Asks the relevant provider to delete |match|, and ensures observers are |
89 // notified of resulting changes immediately. This should only be called when | 90 // notified of resulting changes immediately. This should only be called when |
90 // no query is running. | 91 // no query is running. |
91 void DeleteMatch(const AutocompleteMatch& match); | 92 void DeleteMatch(const AutocompleteMatch& match); |
92 | 93 |
93 // Removes any entries that were copied from the last result. This is used by | 94 // 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. | 95 // the popup to ensure it's not showing an out-of-date query. |
95 void ExpireCopiedEntries(); | 96 void ExpireCopiedEntries(); |
96 | 97 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 // 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 |
250 // notifications until Start() has been invoked on all providers. | 251 // notifications until Start() has been invoked on all providers. |
251 bool in_start_; | 252 bool in_start_; |
252 | 253 |
253 TemplateURLService* template_url_service_; | 254 TemplateURLService* template_url_service_; |
254 | 255 |
255 DISALLOW_COPY_AND_ASSIGN(AutocompleteController); | 256 DISALLOW_COPY_AND_ASSIGN(AutocompleteController); |
256 }; | 257 }; |
257 | 258 |
258 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CONTROLLER_H_ | 259 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CONTROLLER_H_ |
OLD | NEW |