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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 // SearchTermsDataSnapshot | 271 // SearchTermsDataSnapshot |
272 | 272 |
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 ~SearchTermsDataSnapshot() override; |
282 | 282 |
283 virtual std::string GoogleBaseURLValue() const override; | 283 std::string GoogleBaseURLValue() const override; |
284 virtual std::string GetApplicationLocale() const override; | 284 std::string GetApplicationLocale() const override; |
285 virtual base::string16 GetRlzParameterValue( | 285 base::string16 GetRlzParameterValue(bool from_app_list) const override; |
286 bool from_app_list) const override; | 286 std::string GetSearchClient() const override; |
287 virtual std::string GetSearchClient() const override; | 287 bool EnableAnswersInSuggest() const override; |
288 virtual bool EnableAnswersInSuggest() const override; | 288 bool IsShowingSearchTermsOnSearchResultsPages() const override; |
289 virtual bool IsShowingSearchTermsOnSearchResultsPages() const override; | 289 std::string InstantExtendedEnabledParam(bool for_search) const override; |
290 virtual std::string InstantExtendedEnabledParam( | 290 std::string ForceInstantResultsParam(bool for_prerender) const override; |
291 bool for_search) const override; | 291 std::string NTPIsThemedParam() const override; |
292 virtual std::string ForceInstantResultsParam( | 292 std::string GoogleImageSearchSource() const override; |
293 bool for_prerender) const override; | |
294 virtual std::string NTPIsThemedParam() const override; | |
295 virtual std::string GoogleImageSearchSource() const override; | |
296 | 293 |
297 private: | 294 private: |
298 std::string google_base_url_value_; | 295 std::string google_base_url_value_; |
299 std::string application_locale_; | 296 std::string application_locale_; |
300 base::string16 rlz_parameter_value_; | 297 base::string16 rlz_parameter_value_; |
301 std::string search_client_; | 298 std::string search_client_; |
302 bool enable_answers_in_suggest_; | 299 bool enable_answers_in_suggest_; |
303 bool is_showing_search_terms_on_search_results_pages_; | 300 bool is_showing_search_terms_on_search_results_pages_; |
304 std::string instant_extended_enabled_param_; | 301 std::string instant_extended_enabled_param_; |
305 std::string instant_extended_enabled_param_for_search_; | 302 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, | 1155 AutocompleteMatch::ClassifyLocationInString(base::string16::npos, 0, |
1159 match.contents.length(), ACMatchClassification::URL, | 1156 match.contents.length(), ACMatchClassification::URL, |
1160 &match.contents_class); | 1157 &match.contents_class); |
1161 } | 1158 } |
1162 match.description = info.title(); | 1159 match.description = info.title(); |
1163 match.description_class = | 1160 match.description_class = |
1164 ClassifyDescription(params.input.text(), match.description); | 1161 ClassifyDescription(params.input.text(), match.description); |
1165 RecordAdditionalInfoFromUrlRow(info, &match); | 1162 RecordAdditionalInfoFromUrlRow(info, &match); |
1166 return match; | 1163 return match; |
1167 } | 1164 } |
OLD | NEW |