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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 DCHECK(thread_checker_.CalledOnValidThread()); | 96 DCHECK(thread_checker_.CalledOnValidThread()); |
97 return search::InstantExtendedEnabledParam(for_search); | 97 return search::InstantExtendedEnabledParam(for_search); |
98 } | 98 } |
99 | 99 |
100 std::string UIThreadSearchTermsData::ForceInstantResultsParam( | 100 std::string UIThreadSearchTermsData::ForceInstantResultsParam( |
101 bool for_prerender) const { | 101 bool for_prerender) const { |
102 DCHECK(thread_checker_.CalledOnValidThread()); | 102 DCHECK(thread_checker_.CalledOnValidThread()); |
103 return search::ForceInstantResultsParam(for_prerender); | 103 return search::ForceInstantResultsParam(for_prerender); |
104 } | 104 } |
105 | 105 |
106 std::string UIThreadSearchTermsData::IOSWebViewTypeParam() const { | |
107 DCHECK(thread_checker_.CalledOnValidThread()); | |
108 std::string param = experimental_flags::GetWKWebViewSearchParams(); | |
109 if (param.empty()) { | |
110 return std::string(); | |
111 } | |
112 | |
113 return "&esrch=" + net::EscapeQueryParamValue(param, true); | |
114 } | |
115 | |
116 std::string UIThreadSearchTermsData::GoogleImageSearchSource() const { | 106 std::string UIThreadSearchTermsData::GoogleImageSearchSource() const { |
117 DCHECK(thread_checker_.CalledOnValidThread()); | 107 DCHECK(thread_checker_.CalledOnValidThread()); |
118 std::string version(version_info::GetProductName() + " " + | 108 std::string version(version_info::GetProductName() + " " + |
119 version_info::GetVersionNumber()); | 109 version_info::GetVersionNumber()); |
120 if (version_info::IsOfficialBuild()) | 110 if (version_info::IsOfficialBuild()) |
121 version += " (Official)"; | 111 version += " (Official)"; |
122 version += " " + version_info::GetOSType(); | 112 version += " " + version_info::GetOSType(); |
123 std::string modifier(GetChannelString()); | 113 std::string modifier(GetChannelString()); |
124 if (!modifier.empty()) | 114 if (!modifier.empty()) |
125 version += " " + modifier; | 115 version += " " + modifier; |
126 return version; | 116 return version; |
127 } | 117 } |
128 | 118 |
129 } // namespace ios | 119 } // namespace ios |
OLD | NEW |