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 // This file contains the zero-suggest autocomplete provider. This experimental | 5 // This file contains the zero-suggest autocomplete provider. This experimental |
6 // provider is invoked when the user focuses in the omnibox prior to editing, | 6 // provider is invoked when the user focuses in the omnibox prior to editing, |
7 // and generates search query suggestions based on the current URL. | 7 // and generates search query suggestions based on the current URL. |
8 | 8 |
9 #ifndef CHROME_BROWSER_AUTOCOMPLETE_ZERO_SUGGEST_PROVIDER_H_ | 9 #ifndef CHROME_BROWSER_AUTOCOMPLETE_ZERO_SUGGEST_PROVIDER_H_ |
10 #define CHROME_BROWSER_AUTOCOMPLETE_ZERO_SUGGEST_PROVIDER_H_ | 10 #define CHROME_BROWSER_AUTOCOMPLETE_ZERO_SUGGEST_PROVIDER_H_ |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 TemplateURLService* template_url_service, | 53 TemplateURLService* template_url_service, |
54 Profile* profile); | 54 Profile* profile); |
55 | 55 |
56 // Registers a preference used to cache zero suggest results. | 56 // Registers a preference used to cache zero suggest results. |
57 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 57 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
58 | 58 |
59 // AutocompleteProvider: | 59 // AutocompleteProvider: |
60 void Start(const AutocompleteInput& input, | 60 void Start(const AutocompleteInput& input, |
61 bool minimal_changes, | 61 bool minimal_changes, |
62 bool called_due_to_focus) override; | 62 bool called_due_to_focus) override; |
63 void Stop(bool clear_cached_results) override; | 63 void Stop(bool clear_cached_results, |
| 64 bool due_to_user_inactivity) override; |
64 void DeleteMatch(const AutocompleteMatch& match) override; | 65 void DeleteMatch(const AutocompleteMatch& match) override; |
65 void AddProviderInfo(ProvidersInfo* provider_info) const override; | 66 void AddProviderInfo(ProvidersInfo* provider_info) const override; |
66 | 67 |
67 // Sets |field_trial_triggered_| to false. | 68 // Sets |field_trial_triggered_| to false. |
68 void ResetSession() override; | 69 void ResetSession() override; |
69 | 70 |
70 private: | 71 private: |
71 ZeroSuggestProvider(AutocompleteProviderListener* listener, | 72 ZeroSuggestProvider(AutocompleteProviderListener* listener, |
72 TemplateURLService* template_url_service, | 73 TemplateURLService* template_url_service, |
73 Profile* profile); | 74 Profile* profile); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // Whether we are waiting for a most visited visited urls callback to run. | 163 // Whether we are waiting for a most visited visited urls callback to run. |
163 bool waiting_for_most_visited_urls_request_; | 164 bool waiting_for_most_visited_urls_request_; |
164 | 165 |
165 // For callbacks that may be run after destruction. | 166 // For callbacks that may be run after destruction. |
166 base::WeakPtrFactory<ZeroSuggestProvider> weak_ptr_factory_; | 167 base::WeakPtrFactory<ZeroSuggestProvider> weak_ptr_factory_; |
167 | 168 |
168 DISALLOW_COPY_AND_ASSIGN(ZeroSuggestProvider); | 169 DISALLOW_COPY_AND_ASSIGN(ZeroSuggestProvider); |
169 }; | 170 }; |
170 | 171 |
171 #endif // CHROME_BROWSER_AUTOCOMPLETE_ZERO_SUGGEST_PROVIDER_H_ | 172 #endif // CHROME_BROWSER_AUTOCOMPLETE_ZERO_SUGGEST_PROVIDER_H_ |
OLD | NEW |