OLD | NEW |
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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 ContextualSearchParams() | 197 ContextualSearchParams() |
198 : version(-1), | 198 : version(-1), |
199 start(base::string16::npos), | 199 start(base::string16::npos), |
200 end(base::string16::npos), | 200 end(base::string16::npos), |
201 resolve(true) { | 201 resolve(true) { |
202 } | 202 } |
203 | 203 |
204 TemplateURLRef::SearchTermsArgs::ContextualSearchParams:: | 204 TemplateURLRef::SearchTermsArgs::ContextualSearchParams:: |
205 ContextualSearchParams( | 205 ContextualSearchParams( |
206 const int version, | 206 const int version, |
207 const size_t start, | |
208 const size_t end, | |
209 const std::string& selection, | 207 const std::string& selection, |
210 const std::string& content, | |
211 const std::string& base_page_url, | 208 const std::string& base_page_url, |
212 const std::string& encoding) | 209 const bool resolve) |
213 : version(version), | 210 : version(version), |
214 start(start), | 211 start(base::string16::npos), |
215 end(end), | 212 end(base::string16::npos), |
216 selection(selection), | 213 selection(selection), |
217 content(content), | |
218 base_page_url(base_page_url), | 214 base_page_url(base_page_url), |
219 encoding(encoding), | 215 resolve(resolve) { |
220 resolve(true) { | |
221 } | 216 } |
222 | 217 |
223 TemplateURLRef::SearchTermsArgs::ContextualSearchParams:: | 218 TemplateURLRef::SearchTermsArgs::ContextualSearchParams:: |
224 ContextualSearchParams( | 219 ContextualSearchParams( |
225 const int version, | 220 const int version, |
226 const size_t start, | 221 const size_t start, |
227 const size_t end, | 222 const size_t end, |
228 const std::string& selection, | 223 const std::string& selection, |
229 const std::string& content, | 224 const std::string& content, |
230 const std::string& base_page_url, | 225 const std::string& base_page_url, |
(...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1469 // patterns. This means that given patterns | 1464 // patterns. This means that given patterns |
1470 // [ "http://foo/#q={searchTerms}", "http://foo/?q={searchTerms}" ], | 1465 // [ "http://foo/#q={searchTerms}", "http://foo/?q={searchTerms}" ], |
1471 // calling ExtractSearchTermsFromURL() on "http://foo/?q=bar#q=' would | 1466 // calling ExtractSearchTermsFromURL() on "http://foo/?q=bar#q=' would |
1472 // return false. This is important for at least Google, where such URLs | 1467 // return false. This is important for at least Google, where such URLs |
1473 // are invalid. | 1468 // are invalid. |
1474 return !search_terms->empty(); | 1469 return !search_terms->empty(); |
1475 } | 1470 } |
1476 } | 1471 } |
1477 return false; | 1472 return false; |
1478 } | 1473 } |
OLD | NEW |