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

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

Issue 158223002: Part 5 of search provider refactoring. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + fix indentation Created 6 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/autocomplete/base_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 class contains common functionality for search-based autocomplete 5 // This class contains common functionality for search-based autocomplete
6 // providers. Search provider and zero suggest provider both use it for common 6 // providers. Search provider and zero suggest provider both use it for common
7 // functionality. 7 // functionality.
8 8
9 #ifndef CHROME_BROWSER_AUTOCOMPLETE_BASE_SEARCH_PROVIDER_H_ 9 #ifndef CHROME_BROWSER_AUTOCOMPLETE_BASE_SEARCH_PROVIDER_H_
10 #define CHROME_BROWSER_AUTOCOMPLETE_BASE_SEARCH_PROVIDER_H_ 10 #define CHROME_BROWSER_AUTOCOMPLETE_BASE_SEARCH_PROVIDER_H_
(...skipping 25 matching lines...) Expand all
36 public net::URLFetcherDelegate { 36 public net::URLFetcherDelegate {
37 public: 37 public:
38 BaseSearchProvider(AutocompleteProviderListener* listener, 38 BaseSearchProvider(AutocompleteProviderListener* listener,
39 Profile* profile, 39 Profile* profile,
40 AutocompleteProvider::Type type); 40 AutocompleteProvider::Type type);
41 41
42 // Returns whether |match| is flagged as a query that should be prefetched. 42 // Returns whether |match| is flagged as a query that should be prefetched.
43 static bool ShouldPrefetch(const AutocompleteMatch& match); 43 static bool ShouldPrefetch(const AutocompleteMatch& match);
44 44
45 // AutocompleteProvider: 45 // AutocompleteProvider:
46 virtual void Stop(bool clear_cached_results) OVERRIDE;
46 virtual void AddProviderInfo(ProvidersInfo* provider_info) const OVERRIDE; 47 virtual void AddProviderInfo(ProvidersInfo* provider_info) const OVERRIDE;
47 48
48 bool field_trial_triggered_in_session() const { 49 bool field_trial_triggered_in_session() const {
49 return field_trial_triggered_in_session_; 50 return field_trial_triggered_in_session_;
50 } 51 }
51 52
52 protected: 53 protected:
53 // The following keys are used to record additional information on matches. 54 // The following keys are used to record additional information on matches.
54 55
55 // We annotate our AutocompleteMatches with whether their relevance scores 56 // We annotate our AutocompleteMatches with whether their relevance scores
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 352
352 // Returns the AutocompleteInput based on whether the |result| is from the 353 // Returns the AutocompleteInput based on whether the |result| is from the
353 // default provider or from the keyword provider. 354 // default provider or from the keyword provider.
354 virtual const AutocompleteInput GetInput( 355 virtual const AutocompleteInput GetInput(
355 const SuggestResult& result) const = 0; 356 const SuggestResult& result) const = 0;
356 357
357 // Returns whether the destination URL corresponding to the given |result| 358 // Returns whether the destination URL corresponding to the given |result|
358 // should contain command-line-specified query params. 359 // should contain command-line-specified query params.
359 virtual bool ShouldAppendExtraParams(const SuggestResult& result) const = 0; 360 virtual bool ShouldAppendExtraParams(const SuggestResult& result) const = 0;
360 361
362 // Stops the suggest query.
363 // NOTE: This does not update |done_|. Callers must do so.
364 virtual void StopSuggest() = 0;
365
366 // Clears the current results.
367 virtual void ClearAllResults() = 0;
368
361 // Whether a field trial, if any, has triggered in the most recent 369 // Whether a field trial, if any, has triggered in the most recent
362 // autocomplete query. This field is set to true only if the suggestion 370 // autocomplete query. This field is set to true only if the suggestion
363 // provider has completed and the response contained 371 // provider has completed and the response contained
364 // '"google:fieldtrialtriggered":true'. 372 // '"google:fieldtrialtriggered":true'.
365 bool field_trial_triggered_; 373 bool field_trial_triggered_;
366 374
367 // Same as above except that it is maintained across the current Omnibox 375 // Same as above except that it is maintained across the current Omnibox
368 // session. 376 // session.
369 bool field_trial_triggered_in_session_; 377 bool field_trial_triggered_in_session_;
370 378
371 private: 379 private:
372 DISALLOW_COPY_AND_ASSIGN(BaseSearchProvider); 380 DISALLOW_COPY_AND_ASSIGN(BaseSearchProvider);
373 }; 381 };
374 382
375 #endif // CHROME_BROWSER_AUTOCOMPLETE_BASE_SEARCH_PROVIDER_H_ 383 #endif // CHROME_BROWSER_AUTOCOMPLETE_BASE_SEARCH_PROVIDER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autocomplete/base_search_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698