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

Side by Side Diff: chrome/browser/autocomplete/search_provider.h

Issue 439243004: Stop depending on TemplateURLServiceFactory from SearchProvider (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
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 27 matching lines...) Expand all
38 // After construction, the autocomplete controller repeatedly calls Start() 38 // After construction, the autocomplete controller repeatedly calls Start()
39 // with some user input, each time expecting to receive a small set of the best 39 // with some user input, each time expecting to receive a small set of the best
40 // matches (either synchronously or asynchronously). 40 // matches (either synchronously or asynchronously).
41 // 41 //
42 // Initially the provider creates a match that searches for the current input 42 // Initially the provider creates a match that searches for the current input
43 // text. It also starts a task to query the Suggest servers. When that data 43 // text. It also starts a task to query the Suggest servers. When that data
44 // comes back, the provider creates and returns matches for the best 44 // comes back, the provider creates and returns matches for the best
45 // suggestions. 45 // suggestions.
46 class SearchProvider : public BaseSearchProvider { 46 class SearchProvider : public BaseSearchProvider {
47 public: 47 public:
48 SearchProvider(AutocompleteProviderListener* listener, Profile* profile); 48 SearchProvider(AutocompleteProviderListener* listener,
49 TemplateURLService* template_url_service,
50 Profile* profile);
49 51
50 // Extracts the suggest response metadata which SearchProvider previously 52 // Extracts the suggest response metadata which SearchProvider previously
51 // stored for |match|. 53 // stored for |match|.
52 static std::string GetSuggestMetadata(const AutocompleteMatch& match); 54 static std::string GetSuggestMetadata(const AutocompleteMatch& match);
53 55
54 // Answers prefetch handling - register displayed answers. Takes the top 56 // Answers prefetch handling - register displayed answers. Takes the top
55 // match for Autocomplete and registers the contained answer data, if any. 57 // match for Autocomplete and registers the contained answer data, if any.
56 void RegisterDisplayedAnswers(const AutocompleteResult& result); 58 void RegisterDisplayedAnswers(const AutocompleteResult& result);
57 59
58 // AutocompleteProvider: 60 // AutocompleteProvider:
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 base::TimeTicks token_expiration_time_; 342 base::TimeTicks token_expiration_time_;
341 343
342 // Answers prefetch management. 344 // Answers prefetch management.
343 AnswersQueryData prefetch_data_; // Data to use for query prefetching. 345 AnswersQueryData prefetch_data_; // Data to use for query prefetching.
344 AnswersQueryData last_answer_seen_; // Last answer seen. 346 AnswersQueryData last_answer_seen_; // Last answer seen.
345 347
346 DISALLOW_COPY_AND_ASSIGN(SearchProvider); 348 DISALLOW_COPY_AND_ASSIGN(SearchProvider);
347 }; 349 };
348 350
349 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ 351 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/base_search_provider.cc ('k') | chrome/browser/autocomplete/search_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698