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

Side by Side Diff: components/search_engines/template_url.cc

Issue 396583002: Stop depending on InstantService from BaseSearchProvider (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/search_engines/template_url.h" 5 #include "components/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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 175
176 // TemplateURLRef::SearchTermsArgs -------------------------------------------- 176 // TemplateURLRef::SearchTermsArgs --------------------------------------------
177 177
178 TemplateURLRef::SearchTermsArgs::SearchTermsArgs( 178 TemplateURLRef::SearchTermsArgs::SearchTermsArgs(
179 const base::string16& search_terms) 179 const base::string16& search_terms)
180 : search_terms(search_terms), 180 : search_terms(search_terms),
181 input_type(metrics::OmniboxInputType::INVALID), 181 input_type(metrics::OmniboxInputType::INVALID),
182 accepted_suggestion(NO_SUGGESTIONS_AVAILABLE), 182 accepted_suggestion(NO_SUGGESTIONS_AVAILABLE),
183 cursor_position(base::string16::npos), 183 cursor_position(base::string16::npos),
184 omnibox_start_margin(-1), 184 enable_omnibox_start_margin(false),
185 page_classification(metrics::OmniboxEventProto::INVALID_SPEC), 185 page_classification(metrics::OmniboxEventProto::INVALID_SPEC),
186 bookmark_bar_pinned(false), 186 bookmark_bar_pinned(false),
187 append_extra_query_params(false), 187 append_extra_query_params(false),
188 force_instant_results(false), 188 force_instant_results(false),
189 from_app_list(false), 189 from_app_list(false),
190 contextual_search_params(ContextualSearchParams()) { 190 contextual_search_params(ContextualSearchParams()) {
191 } 191 }
192 192
193 TemplateURLRef::SearchTermsArgs::~SearchTermsArgs() { 193 TemplateURLRef::SearchTermsArgs::~SearchTermsArgs() {
194 } 194 }
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 break; 913 break;
914 914
915 case GOOGLE_NTP_IS_THEMED: 915 case GOOGLE_NTP_IS_THEMED:
916 DCHECK(!i->is_post_param); 916 DCHECK(!i->is_post_param);
917 HandleReplacement( 917 HandleReplacement(
918 std::string(), search_terms_data.NTPIsThemedParam(), *i, &url); 918 std::string(), search_terms_data.NTPIsThemedParam(), *i, &url);
919 break; 919 break;
920 920
921 case GOOGLE_OMNIBOX_START_MARGIN: 921 case GOOGLE_OMNIBOX_START_MARGIN:
922 DCHECK(!i->is_post_param); 922 DCHECK(!i->is_post_param);
923 if (search_terms_args.omnibox_start_margin >= 0) { 923 if (search_terms_args.enable_omnibox_start_margin) {
924 HandleReplacement( 924 int omnibox_start_margin = search_terms_data.OmniboxStartMargin();
925 "es_sm", 925 if (omnibox_start_margin >= 0) {
926 base::IntToString(search_terms_args.omnibox_start_margin), 926 HandleReplacement("es_sm", base::IntToString(omnibox_start_margin),
927 *i, 927 *i, &url);
928 &url); 928 }
929 } 929 }
930 break; 930 break;
931 931
932 case GOOGLE_CONTEXTUAL_SEARCH_VERSION: 932 case GOOGLE_CONTEXTUAL_SEARCH_VERSION:
933 if (search_terms_args.contextual_search_params.version >= 0) { 933 if (search_terms_args.contextual_search_params.version >= 0) {
934 HandleReplacement( 934 HandleReplacement(
935 "ctxs", 935 "ctxs",
936 base::IntToString( 936 base::IntToString(
937 search_terms_args.contextual_search_params.version), 937 search_terms_args.contextual_search_params.version),
938 *i, 938 *i,
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
1444 // patterns. This means that given patterns 1444 // patterns. This means that given patterns
1445 // [ "http://foo/#q={searchTerms}", "http://foo/?q={searchTerms}" ], 1445 // [ "http://foo/#q={searchTerms}", "http://foo/?q={searchTerms}" ],
1446 // calling ExtractSearchTermsFromURL() on "http://foo/?q=bar#q=' would 1446 // calling ExtractSearchTermsFromURL() on "http://foo/?q=bar#q=' would
1447 // return false. This is important for at least Google, where such URLs 1447 // return false. This is important for at least Google, where such URLs
1448 // are invalid. 1448 // are invalid.
1449 return !search_terms->empty(); 1449 return !search_terms->empty();
1450 } 1450 }
1451 } 1451 }
1452 return false; 1452 return false;
1453 } 1453 }
OLDNEW
« no previous file with comments | « components/search_engines/template_url.h ('k') | components/search_engines/template_url_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698