| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/search_engines/ui_thread_search_terms_data.h" | 5 #include "ios/chrome/browser/search_engines/ui_thread_search_terms_data.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "components/google/core/browser/google_url_tracker.h" | 9 #include "components/google/core/browser/google_url_tracker.h" |
| 10 #include "components/google/core/browser/google_util.h" | 10 #include "components/google/core/browser/google_util.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 std::string UIThreadSearchTermsData::GetSuggestClient() const { | 84 std::string UIThreadSearchTermsData::GetSuggestClient() const { |
| 85 DCHECK(thread_checker_.CalledOnValidThread()); | 85 DCHECK(thread_checker_.CalledOnValidThread()); |
| 86 return search::IsInstantExtendedAPIEnabled() ? "chrome-omni" : "chrome"; | 86 return search::IsInstantExtendedAPIEnabled() ? "chrome-omni" : "chrome"; |
| 87 } | 87 } |
| 88 | 88 |
| 89 std::string UIThreadSearchTermsData::GetSuggestRequestIdentifier() const { | 89 std::string UIThreadSearchTermsData::GetSuggestRequestIdentifier() const { |
| 90 DCHECK(thread_checker_.CalledOnValidThread()); | 90 DCHECK(thread_checker_.CalledOnValidThread()); |
| 91 return "chrome-ext-ansg"; | 91 return "chrome-ext-ansg"; |
| 92 } | 92 } |
| 93 | 93 |
| 94 std::string UIThreadSearchTermsData::InstantExtendedEnabledParam( | 94 std::string UIThreadSearchTermsData::InstantExtendedEnabledParam() const { |
| 95 bool for_search) const { | |
| 96 DCHECK(thread_checker_.CalledOnValidThread()); | 95 DCHECK(thread_checker_.CalledOnValidThread()); |
| 97 return search::InstantExtendedEnabledParam(for_search); | 96 return search::InstantExtendedEnabledParam(); |
| 98 } | 97 } |
| 99 | 98 |
| 100 std::string UIThreadSearchTermsData::ForceInstantResultsParam( | 99 std::string UIThreadSearchTermsData::ForceInstantResultsParam( |
| 101 bool for_prerender) const { | 100 bool for_prerender) const { |
| 102 DCHECK(thread_checker_.CalledOnValidThread()); | 101 DCHECK(thread_checker_.CalledOnValidThread()); |
| 103 return search::ForceInstantResultsParam(for_prerender); | 102 return search::ForceInstantResultsParam(for_prerender); |
| 104 } | 103 } |
| 105 | 104 |
| 106 std::string UIThreadSearchTermsData::GoogleImageSearchSource() const { | 105 std::string UIThreadSearchTermsData::GoogleImageSearchSource() const { |
| 107 DCHECK(thread_checker_.CalledOnValidThread()); | 106 DCHECK(thread_checker_.CalledOnValidThread()); |
| 108 std::string version(version_info::GetProductName() + " " + | 107 std::string version(version_info::GetProductName() + " " + |
| 109 version_info::GetVersionNumber()); | 108 version_info::GetVersionNumber()); |
| 110 if (version_info::IsOfficialBuild()) | 109 if (version_info::IsOfficialBuild()) |
| 111 version += " (Official)"; | 110 version += " (Official)"; |
| 112 version += " " + version_info::GetOSType(); | 111 version += " " + version_info::GetOSType(); |
| 113 std::string modifier(GetChannelString()); | 112 std::string modifier(GetChannelString()); |
| 114 if (!modifier.empty()) | 113 if (!modifier.empty()) |
| 115 version += " " + modifier; | 114 version += " " + modifier; |
| 116 return version; | 115 return version; |
| 117 } | 116 } |
| 118 | 117 |
| 119 } // namespace ios | 118 } // namespace ios |
| OLD | NEW |