| 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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/guid.h" | 10 #include "base/guid.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 return "unknown"; | 179 return "unknown"; |
| 180 } | 180 } |
| 181 | 181 |
| 182 bool IsTemplateParameterString(const std::string& param) { | 182 bool IsTemplateParameterString(const std::string& param) { |
| 183 return (param.length() > 2) && (*(param.begin()) == kStartParameter) && | 183 return (param.length() > 2) && (*(param.begin()) == kStartParameter) && |
| 184 (*(param.rbegin()) == kEndParameter); | 184 (*(param.rbegin()) == kEndParameter); |
| 185 } | 185 } |
| 186 | 186 |
| 187 bool ShowingSearchTermsOnSRP() { | 187 bool ShowingSearchTermsOnSRP() { |
| 188 return chrome::IsInstantExtendedAPIEnabled() && | 188 return chrome::IsInstantExtendedAPIEnabled() && |
| 189 !chrome::ShouldSuppressInstantExtendedOnSRP(); | 189 chrome::IsQueryExtractionEnabled(); |
| 190 } | 190 } |
| 191 | 191 |
| 192 } // namespace | 192 } // namespace |
| 193 | 193 |
| 194 | 194 |
| 195 // TemplateURLRef::SearchTermsArgs -------------------------------------------- | 195 // TemplateURLRef::SearchTermsArgs -------------------------------------------- |
| 196 | 196 |
| 197 TemplateURLRef::SearchTermsArgs::SearchTermsArgs(const string16& search_terms) | 197 TemplateURLRef::SearchTermsArgs::SearchTermsArgs(const string16& search_terms) |
| 198 : search_terms(search_terms), | 198 : search_terms(search_terms), |
| 199 accepted_suggestion(NO_SUGGESTIONS_AVAILABLE), | 199 accepted_suggestion(NO_SUGGESTIONS_AVAILABLE), |
| (...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1301 // patterns. This means that given patterns | 1301 // patterns. This means that given patterns |
| 1302 // [ "http://foo/#q={searchTerms}", "http://foo/?q={searchTerms}" ], | 1302 // [ "http://foo/#q={searchTerms}", "http://foo/?q={searchTerms}" ], |
| 1303 // calling ExtractSearchTermsFromURL() on "http://foo/?q=bar#q=' would | 1303 // calling ExtractSearchTermsFromURL() on "http://foo/?q=bar#q=' would |
| 1304 // return false. This is important for at least Google, where such URLs | 1304 // return false. This is important for at least Google, where such URLs |
| 1305 // are invalid. | 1305 // are invalid. |
| 1306 return !search_terms->empty(); | 1306 return !search_terms->empty(); |
| 1307 } | 1307 } |
| 1308 } | 1308 } |
| 1309 return false; | 1309 return false; |
| 1310 } | 1310 } |
| OLD | NEW |