Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(852)

Side by Side Diff: components/omnibox/search_provider.h

Issue 836213002: Assume all providers may give zero suggest responses. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation issue in athena Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/omnibox/keyword_provider_unittest.cc ('k') | components/omnibox/search_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 Search autocomplete provider. This provider is 5 // This file contains the Search autocomplete provider. This provider is
6 // responsible for all autocomplete entries that start with "Search <engine> 6 // responsible for all autocomplete entries that start with "Search <engine>
7 // for ...", including searching for the current input string, search 7 // for ...", including searching for the current input string, search
8 // history, and search suggestions. An instance of it gets created and 8 // history, and search suggestions. An instance of it gets created and
9 // managed by the autocomplete controller. 9 // managed by the autocomplete controller.
10 10
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 DontInlineAutocompleteAsynchronously); 82 DontInlineAutocompleteAsynchronously);
83 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, NavigationInline); 83 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, NavigationInline);
84 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, NavigationInlineDomainClassify); 84 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, NavigationInlineDomainClassify);
85 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, NavigationInlineSchemeSubstring); 85 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, NavigationInlineSchemeSubstring);
86 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, SuggestRelevanceExperiment); 86 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, SuggestRelevanceExperiment);
87 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, TestDeleteMatch); 87 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, TestDeleteMatch);
88 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, SuggestQueryUsesToken); 88 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, SuggestQueryUsesToken);
89 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, SessionToken); 89 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, SessionToken);
90 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, AnswersCache); 90 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, AnswersCache);
91 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, RemoveExtraAnswers); 91 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, RemoveExtraAnswers);
92 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, DoesNotProvideOnFocus);
92 FRIEND_TEST_ALL_PREFIXES(AutocompleteProviderTest, GetDestinationURL); 93 FRIEND_TEST_ALL_PREFIXES(AutocompleteProviderTest, GetDestinationURL);
93 FRIEND_TEST_ALL_PREFIXES(InstantExtendedPrefetchTest, ClearPrefetchedResults); 94 FRIEND_TEST_ALL_PREFIXES(InstantExtendedPrefetchTest, ClearPrefetchedResults);
94 FRIEND_TEST_ALL_PREFIXES(InstantExtendedPrefetchTest, SetPrefetchQuery); 95 FRIEND_TEST_ALL_PREFIXES(InstantExtendedPrefetchTest, SetPrefetchQuery);
95 96
96 // Manages the providers (TemplateURLs) used by SearchProvider. Two providers 97 // Manages the providers (TemplateURLs) used by SearchProvider. Two providers
97 // may be used: 98 // may be used:
98 // . The default provider. This corresponds to the user's default search 99 // . The default provider. This corresponds to the user's default search
99 // engine. This is always used, except for the rare case of no default 100 // engine. This is always used, except for the rare case of no default
100 // engine. 101 // engine.
101 // . The keyword provider. This is used if the user has typed in a keyword. 102 // . The keyword provider. This is used if the user has typed in a keyword.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 bool prefer_keyword); 152 bool prefer_keyword);
152 153
153 // A helper function for UpdateAllOldResults(). 154 // A helper function for UpdateAllOldResults().
154 static void UpdateOldResults(bool minimal_changes, 155 static void UpdateOldResults(bool minimal_changes,
155 SearchSuggestionParser::Results* results); 156 SearchSuggestionParser::Results* results);
156 157
157 // Returns the first match in |matches| which might be chosen as default. 158 // Returns the first match in |matches| which might be chosen as default.
158 static ACMatches::iterator FindTopMatch(ACMatches* matches); 159 static ACMatches::iterator FindTopMatch(ACMatches* matches);
159 160
160 // AutocompleteProvider: 161 // AutocompleteProvider:
161 void Start(const AutocompleteInput& input, bool minimal_changes) override; 162 void Start(const AutocompleteInput& input,
163 bool minimal_changes,
164 bool called_due_to_focus) override;
162 void Stop(bool clear_cached_results) override; 165 void Stop(bool clear_cached_results) override;
163 166
164 // BaseSearchProvider: 167 // BaseSearchProvider:
165 const TemplateURL* GetTemplateURL(bool is_keyword) const override; 168 const TemplateURL* GetTemplateURL(bool is_keyword) const override;
166 const AutocompleteInput GetInput(bool is_keyword) const override; 169 const AutocompleteInput GetInput(bool is_keyword) const override;
167 bool ShouldAppendExtraParams( 170 bool ShouldAppendExtraParams(
168 const SearchSuggestionParser::SuggestResult& result) const override; 171 const SearchSuggestionParser::SuggestResult& result) const override;
169 void RecordDeletionResult(bool success) override; 172 void RecordDeletionResult(bool success) override;
170 173
171 // net::URLFetcherDelegate: 174 // net::URLFetcherDelegate:
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 base::TimeTicks token_expiration_time_; 397 base::TimeTicks token_expiration_time_;
395 398
396 // Answers prefetch management. 399 // Answers prefetch management.
397 AnswersCache answers_cache_; // Cache for last answers seen. 400 AnswersCache answers_cache_; // Cache for last answers seen.
398 AnswersQueryData prefetch_data_; // Data to use for query prefetching. 401 AnswersQueryData prefetch_data_; // Data to use for query prefetching.
399 402
400 DISALLOW_COPY_AND_ASSIGN(SearchProvider); 403 DISALLOW_COPY_AND_ASSIGN(SearchProvider);
401 }; 404 };
402 405
403 #endif // COMPONENTS_OMNIBOX_SEARCH_PROVIDER_H_ 406 #endif // COMPONENTS_OMNIBOX_SEARCH_PROVIDER_H_
OLDNEW
« no previous file with comments | « components/omnibox/keyword_provider_unittest.cc ('k') | components/omnibox/search_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698