| 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/search_engines/template_url.h" | 5 #include "chrome/browser/search_engines/template_url.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 return "unknown"; | 182 return "unknown"; |
| 183 } | 183 } |
| 184 | 184 |
| 185 bool IsTemplateParameterString(const std::string& param) { | 185 bool IsTemplateParameterString(const std::string& param) { |
| 186 return (param.length() > 2) && (*(param.begin()) == kStartParameter) && | 186 return (param.length() > 2) && (*(param.begin()) == kStartParameter) && |
| 187 (*(param.rbegin()) == kEndParameter); | 187 (*(param.rbegin()) == kEndParameter); |
| 188 } | 188 } |
| 189 | 189 |
| 190 bool ShowingSearchTermsOnSRP() { | 190 bool ShowingSearchTermsOnSRP() { |
| 191 return chrome::IsInstantExtendedAPIEnabled() && | 191 return chrome::IsInstantExtendedAPIEnabled() && |
| 192 !chrome::ShouldSuppressInstantExtendedOnSRP(); | 192 chrome::IsQueryExtractionEnabled(); |
| 193 } | 193 } |
| 194 | 194 |
| 195 } // namespace | 195 } // namespace |
| 196 | 196 |
| 197 | 197 |
| 198 // TemplateURLRef::SearchTermsArgs -------------------------------------------- | 198 // TemplateURLRef::SearchTermsArgs -------------------------------------------- |
| 199 | 199 |
| 200 TemplateURLRef::SearchTermsArgs::SearchTermsArgs(const string16& search_terms) | 200 TemplateURLRef::SearchTermsArgs::SearchTermsArgs(const string16& search_terms) |
| 201 : search_terms(search_terms), | 201 : search_terms(search_terms), |
| 202 accepted_suggestion(NO_SUGGESTIONS_AVAILABLE), | 202 accepted_suggestion(NO_SUGGESTIONS_AVAILABLE), |
| (...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1318 // patterns. This means that given patterns | 1318 // patterns. This means that given patterns |
| 1319 // [ "http://foo/#q={searchTerms}", "http://foo/?q={searchTerms}" ], | 1319 // [ "http://foo/#q={searchTerms}", "http://foo/?q={searchTerms}" ], |
| 1320 // calling ExtractSearchTermsFromURL() on "http://foo/?q=bar#q=' would | 1320 // calling ExtractSearchTermsFromURL() on "http://foo/?q=bar#q=' would |
| 1321 // return false. This is important for at least Google, where such URLs | 1321 // return false. This is important for at least Google, where such URLs |
| 1322 // are invalid. | 1322 // are invalid. |
| 1323 return !search_terms->empty(); | 1323 return !search_terms->empty(); |
| 1324 } | 1324 } |
| 1325 } | 1325 } |
| 1326 return false; | 1326 return false; |
| 1327 } | 1327 } |
| OLD | NEW |