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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 // Called when the omnibox is focused while no existing user input is in | 83 // Called when the omnibox is focused while no existing user input is in |
84 // progress. This is used to trigger any providers which want to provide | 84 // progress. This is used to call Start() on all providers with |
85 // matches in response to focus. See | 85 // |called_due_to_focus| parameter set to check if they want to provide |
86 // AutocompleteProvider::ProvidesMatchesOnOmniboxFocus(). | 86 // on focus matches. |
87 void OnOmniboxFocused(const AutocompleteInput& input); | 87 void OnOmniboxFocused(const AutocompleteInput& input); |
88 | 88 |
89 // Asks the relevant provider to delete |match|, and ensures observers are | 89 // Asks the relevant provider to delete |match|, and ensures observers are |
90 // notified of resulting changes immediately. This should only be called when | 90 // notified of resulting changes immediately. This should only be called when |
91 // no query is running. | 91 // no query is running. |
92 void DeleteMatch(const AutocompleteMatch& match); | 92 void DeleteMatch(const AutocompleteMatch& match); |
93 | 93 |
94 // 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 |
95 // 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. |
96 void ExpireCopiedEntries(); | 96 void ExpireCopiedEntries(); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 // 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 |
251 // notifications until Start() has been invoked on all providers. | 251 // notifications until Start() has been invoked on all providers. |
252 bool in_start_; | 252 bool in_start_; |
253 | 253 |
254 TemplateURLService* template_url_service_; | 254 TemplateURLService* template_url_service_; |
255 | 255 |
256 DISALLOW_COPY_AND_ASSIGN(AutocompleteController); | 256 DISALLOW_COPY_AND_ASSIGN(AutocompleteController); |
257 }; | 257 }; |
258 | 258 |
259 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CONTROLLER_H_ | 259 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CONTROLLER_H_ |
OLD | NEW |