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

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

Issue 165163002: Handle Search suggest subtypes for Shortcuts DB (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 6 years, 9 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 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // ID used in creating URLFetcher for deleting suggestion results. 47 // ID used in creating URLFetcher for deleting suggestion results.
48 static const int kDeletionURLFetcherID; 48 static const int kDeletionURLFetcherID;
49 49
50 BaseSearchProvider(AutocompleteProviderListener* listener, 50 BaseSearchProvider(AutocompleteProviderListener* listener,
51 Profile* profile, 51 Profile* profile,
52 AutocompleteProvider::Type type); 52 AutocompleteProvider::Type type);
53 53
54 // Returns whether |match| is flagged as a query that should be prefetched. 54 // Returns whether |match| is flagged as a query that should be prefetched.
55 static bool ShouldPrefetch(const AutocompleteMatch& match); 55 static bool ShouldPrefetch(const AutocompleteMatch& match);
56 56
57 // Returns a simpler AutocompleteMatch suitable for persistence like in
58 // ShortcutsDatabase.
59 // NOTE: Use with care. Most likely you want the other CreateSearchSuggestion
60 // with protected access.
61 static AutocompleteMatch CreateSearchSuggestion(
62 const base::string16& suggestion,
63 AutocompleteMatchType::Type type,
64 const base::string16& match_contents,
65 bool from_keyword_provider,
66 const TemplateURL* template_url);
67
57 // AutocompleteProvider: 68 // AutocompleteProvider:
58 virtual void Stop(bool clear_cached_results) OVERRIDE; 69 virtual void Stop(bool clear_cached_results) OVERRIDE;
59 virtual void DeleteMatch(const AutocompleteMatch& match) OVERRIDE; 70 virtual void DeleteMatch(const AutocompleteMatch& match) OVERRIDE;
60 virtual void AddProviderInfo(ProvidersInfo* provider_info) const OVERRIDE; 71 virtual void AddProviderInfo(ProvidersInfo* provider_info) const OVERRIDE;
61 72
62 bool field_trial_triggered_in_session() const { 73 bool field_trial_triggered_in_session() const {
63 return field_trial_triggered_in_session_; 74 return field_trial_triggered_in_session_;
64 } 75 }
65 76
66 protected: 77 protected:
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 477
467 // Each deletion handler in this vector corresponds to an outstanding request 478 // Each deletion handler in this vector corresponds to an outstanding request
468 // that a server delete a personalized suggestion. Making this a ScopedVector 479 // that a server delete a personalized suggestion. Making this a ScopedVector
469 // causes us to auto-cancel all such requests on shutdown. 480 // causes us to auto-cancel all such requests on shutdown.
470 SuggestionDeletionHandlers deletion_handlers_; 481 SuggestionDeletionHandlers deletion_handlers_;
471 482
472 DISALLOW_COPY_AND_ASSIGN(BaseSearchProvider); 483 DISALLOW_COPY_AND_ASSIGN(BaseSearchProvider);
473 }; 484 };
474 485
475 #endif // CHROME_BROWSER_AUTOCOMPLETE_BASE_SEARCH_PROVIDER_H_ 486 #endif // CHROME_BROWSER_AUTOCOMPLETE_BASE_SEARCH_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698