Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: chrome/browser/search_engines/template_url.cc

Issue 73613002: InstantExtended: remove old flags, add new flag for query extraction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/search/search_unittest.cc ('k') | chrome/browser/ui/bookmarks/bookmark_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698