OLD | NEW |
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 #include "chrome/browser/autocomplete/history_url_provider.h" | 5 #include "chrome/browser/autocomplete/history_url_provider.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 // Implementation of SearchTermsData that takes a snapshot of another | 273 // Implementation of SearchTermsData that takes a snapshot of another |
274 // SearchTermsData by copying all the responses to the different getters into | 274 // SearchTermsData by copying all the responses to the different getters into |
275 // member strings, then returning those strings when its own getters are called. | 275 // member strings, then returning those strings when its own getters are called. |
276 // This will typically be constructed on the UI thread from | 276 // This will typically be constructed on the UI thread from |
277 // UIThreadSearchTermsData but is subsequently safe to use on any thread. | 277 // UIThreadSearchTermsData but is subsequently safe to use on any thread. |
278 class SearchTermsDataSnapshot : public SearchTermsData { | 278 class SearchTermsDataSnapshot : public SearchTermsData { |
279 public: | 279 public: |
280 explicit SearchTermsDataSnapshot(const SearchTermsData& search_terms_data); | 280 explicit SearchTermsDataSnapshot(const SearchTermsData& search_terms_data); |
281 virtual ~SearchTermsDataSnapshot(); | 281 virtual ~SearchTermsDataSnapshot(); |
282 | 282 |
283 virtual std::string GoogleBaseURLValue() const OVERRIDE; | 283 virtual std::string GoogleBaseURLValue() const override; |
284 virtual std::string GetApplicationLocale() const OVERRIDE; | 284 virtual std::string GetApplicationLocale() const override; |
285 virtual base::string16 GetRlzParameterValue( | 285 virtual base::string16 GetRlzParameterValue( |
286 bool from_app_list) const OVERRIDE; | 286 bool from_app_list) const override; |
287 virtual std::string GetSearchClient() const OVERRIDE; | 287 virtual std::string GetSearchClient() const override; |
288 virtual bool EnableAnswersInSuggest() const OVERRIDE; | 288 virtual bool EnableAnswersInSuggest() const override; |
289 virtual bool IsShowingSearchTermsOnSearchResultsPages() const OVERRIDE; | 289 virtual bool IsShowingSearchTermsOnSearchResultsPages() const override; |
290 virtual std::string InstantExtendedEnabledParam( | 290 virtual std::string InstantExtendedEnabledParam( |
291 bool for_search) const OVERRIDE; | 291 bool for_search) const override; |
292 virtual std::string ForceInstantResultsParam( | 292 virtual std::string ForceInstantResultsParam( |
293 bool for_prerender) const OVERRIDE; | 293 bool for_prerender) const override; |
294 virtual std::string NTPIsThemedParam() const OVERRIDE; | 294 virtual std::string NTPIsThemedParam() const override; |
295 virtual std::string GoogleImageSearchSource() const OVERRIDE; | 295 virtual std::string GoogleImageSearchSource() const override; |
296 | 296 |
297 private: | 297 private: |
298 std::string google_base_url_value_; | 298 std::string google_base_url_value_; |
299 std::string application_locale_; | 299 std::string application_locale_; |
300 base::string16 rlz_parameter_value_; | 300 base::string16 rlz_parameter_value_; |
301 std::string search_client_; | 301 std::string search_client_; |
302 bool enable_answers_in_suggest_; | 302 bool enable_answers_in_suggest_; |
303 bool is_showing_search_terms_on_search_results_pages_; | 303 bool is_showing_search_terms_on_search_results_pages_; |
304 std::string instant_extended_enabled_param_; | 304 std::string instant_extended_enabled_param_; |
305 std::string instant_extended_enabled_param_for_search_; | 305 std::string instant_extended_enabled_param_for_search_; |
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1158 AutocompleteMatch::ClassifyLocationInString(base::string16::npos, 0, | 1158 AutocompleteMatch::ClassifyLocationInString(base::string16::npos, 0, |
1159 match.contents.length(), ACMatchClassification::URL, | 1159 match.contents.length(), ACMatchClassification::URL, |
1160 &match.contents_class); | 1160 &match.contents_class); |
1161 } | 1161 } |
1162 match.description = info.title(); | 1162 match.description = info.title(); |
1163 match.description_class = | 1163 match.description_class = |
1164 ClassifyDescription(params.input.text(), match.description); | 1164 ClassifyDescription(params.input.text(), match.description); |
1165 RecordAdditionalInfoFromUrlRow(info, &match); | 1165 RecordAdditionalInfoFromUrlRow(info, &match); |
1166 return match; | 1166 return match; |
1167 } | 1167 } |
OLD | NEW |