| OLD | NEW |
| 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 COMPONENTS_OMNIBOX_BASE_SEARCH_PROVIDER_H_ | 9 #ifndef COMPONENTS_OMNIBOX_BASE_SEARCH_PROVIDER_H_ |
| 10 #define COMPONENTS_OMNIBOX_BASE_SEARCH_PROVIDER_H_ | 10 #define COMPONENTS_OMNIBOX_BASE_SEARCH_PROVIDER_H_ |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // NOTE: Use with care. Most likely you want the other CreateSearchSuggestion | 62 // NOTE: Use with care. Most likely you want the other CreateSearchSuggestion |
| 63 // with protected access. | 63 // with protected access. |
| 64 static AutocompleteMatch CreateSearchSuggestion( | 64 static AutocompleteMatch CreateSearchSuggestion( |
| 65 const base::string16& suggestion, | 65 const base::string16& suggestion, |
| 66 AutocompleteMatchType::Type type, | 66 AutocompleteMatchType::Type type, |
| 67 bool from_keyword_provider, | 67 bool from_keyword_provider, |
| 68 const TemplateURL* template_url, | 68 const TemplateURL* template_url, |
| 69 const SearchTermsData& search_terms_data); | 69 const SearchTermsData& search_terms_data); |
| 70 | 70 |
| 71 // AutocompleteProvider: | 71 // AutocompleteProvider: |
| 72 virtual void DeleteMatch(const AutocompleteMatch& match) OVERRIDE; | 72 virtual void DeleteMatch(const AutocompleteMatch& match) override; |
| 73 virtual void AddProviderInfo(ProvidersInfo* provider_info) const OVERRIDE; | 73 virtual void AddProviderInfo(ProvidersInfo* provider_info) const override; |
| 74 | 74 |
| 75 bool field_trial_triggered_in_session() const { | 75 bool field_trial_triggered_in_session() const { |
| 76 return field_trial_triggered_in_session_; | 76 return field_trial_triggered_in_session_; |
| 77 } | 77 } |
| 78 | 78 |
| 79 protected: | 79 protected: |
| 80 // The following keys are used to record additional information on matches. | 80 // The following keys are used to record additional information on matches. |
| 81 | 81 |
| 82 // We annotate our AutocompleteMatches with whether their relevance scores | 82 // We annotate our AutocompleteMatches with whether their relevance scores |
| 83 // were server-provided using this key in the |additional_info| field. | 83 // were server-provided using this key in the |additional_info| field. |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 | 248 |
| 249 // Each deletion handler in this vector corresponds to an outstanding request | 249 // Each deletion handler in this vector corresponds to an outstanding request |
| 250 // that a server delete a personalized suggestion. Making this a ScopedVector | 250 // that a server delete a personalized suggestion. Making this a ScopedVector |
| 251 // causes us to auto-cancel all such requests on shutdown. | 251 // causes us to auto-cancel all such requests on shutdown. |
| 252 SuggestionDeletionHandlers deletion_handlers_; | 252 SuggestionDeletionHandlers deletion_handlers_; |
| 253 | 253 |
| 254 DISALLOW_COPY_AND_ASSIGN(BaseSearchProvider); | 254 DISALLOW_COPY_AND_ASSIGN(BaseSearchProvider); |
| 255 }; | 255 }; |
| 256 | 256 |
| 257 #endif // COMPONENTS_OMNIBOX_BASE_SEARCH_PROVIDER_H_ | 257 #endif // COMPONENTS_OMNIBOX_BASE_SEARCH_PROVIDER_H_ |
| OLD | NEW |