OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/search_engines/search_terms_data.h" | 5 #include "chrome/browser/search_engines/search_terms_data.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 uint32 instant_extended_api_version = | 134 uint32 instant_extended_api_version = |
135 chrome::search::EmbeddedSearchPageVersion(profile_); | 135 chrome::search::EmbeddedSearchPageVersion(profile_); |
136 if (instant_extended_api_version == 0 && | 136 if (instant_extended_api_version == 0 && |
137 chrome::BrowserInstantController::IsInstantEnabled(profile_)) | 137 chrome::BrowserInstantController::IsInstantEnabled(profile_)) |
138 return "ion=1&"; | 138 return "ion=1&"; |
139 } | 139 } |
140 return std::string(); | 140 return std::string(); |
141 } | 141 } |
142 | 142 |
143 std::string UIThreadSearchTermsData::InstantExtendedEnabledParam() const { | 143 std::string UIThreadSearchTermsData::InstantExtendedEnabledParam() const { |
144 #if defined(OS_IOS) || defined(OS_ANDROID) | |
Peter Kasting
2013/03/01 21:44:44
You're omitting the threading assertion and the pr
Yusuf
2013/03/01 22:26:07
Done.
| |
145 if (chrome::search::IsQueryExtractionEnabled(profile_) && | |
146 GURL(GoogleBaseURLValue()).SchemeIsSecure()) | |
Peter Kasting
2013/03/01 21:44:44
Shouldn't we be checking scheme security elsewhere
Yusuf
2013/03/01 22:26:07
You are right. Apparently it is already checked in
rohitrao (ping after 24h)
2013/03/01 22:38:26
We have to be a little careful here, because we do
| |
147 return std::string(google_util::kInstantExtendedAPIParam) + "=" + | |
148 std::string(google_util::kInstantExtendedDefaultAPIVersion) + "&"; | |
Peter Kasting
2013/03/01 21:44:44
If you're already modifying UIThreadSearchTermsDat
Yusuf
2013/03/01 22:26:07
Done.
| |
149 #else | |
144 DCHECK(!BrowserThread::IsWellKnownThread(BrowserThread::UI) || | 150 DCHECK(!BrowserThread::IsWellKnownThread(BrowserThread::UI) || |
145 BrowserThread::CurrentlyOn(BrowserThread::UI)); | 151 BrowserThread::CurrentlyOn(BrowserThread::UI)); |
146 if (profile_) { | 152 if (profile_) { |
147 uint32 instant_extended_api_version = | 153 uint32 instant_extended_api_version = |
148 chrome::search::EmbeddedSearchPageVersion(profile_); | 154 chrome::search::EmbeddedSearchPageVersion(profile_); |
149 if (instant_extended_api_version != 0) { | 155 if (instant_extended_api_version != 0) { |
150 return std::string(google_util::kInstantExtendedAPIParam) + "=" + | 156 return std::string(google_util::kInstantExtendedAPIParam) + "=" + |
151 base::Uint64ToString(instant_extended_api_version) + "&"; | 157 base::Uint64ToString(instant_extended_api_version) + "&"; |
152 } | 158 } |
153 } | 159 } |
160 #endif | |
154 return std::string(); | 161 return std::string(); |
155 } | 162 } |
156 | 163 |
157 // static | 164 // static |
158 void UIThreadSearchTermsData::SetGoogleBaseURL(const std::string& base_url) { | 165 void UIThreadSearchTermsData::SetGoogleBaseURL(const std::string& base_url) { |
159 delete google_base_url_; | 166 delete google_base_url_; |
160 google_base_url_ = base_url.empty() ? NULL : new std::string(base_url); | 167 google_base_url_ = base_url.empty() ? NULL : new std::string(base_url); |
161 } | 168 } |
OLD | NEW |