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/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 : search_terms(search_terms), | 146 : search_terms(search_terms), |
147 input_type(metrics::OmniboxInputType::INVALID), | 147 input_type(metrics::OmniboxInputType::INVALID), |
148 accepted_suggestion(NO_SUGGESTIONS_AVAILABLE), | 148 accepted_suggestion(NO_SUGGESTIONS_AVAILABLE), |
149 cursor_position(base::string16::npos), | 149 cursor_position(base::string16::npos), |
150 page_classification(metrics::OmniboxEventProto::INVALID_SPEC), | 150 page_classification(metrics::OmniboxEventProto::INVALID_SPEC), |
151 append_extra_query_params(false), | 151 append_extra_query_params(false), |
152 force_instant_results(false), | 152 force_instant_results(false), |
153 from_app_list(false), | 153 from_app_list(false), |
154 contextual_search_params(ContextualSearchParams()) {} | 154 contextual_search_params(ContextualSearchParams()) {} |
155 | 155 |
| 156 TemplateURLRef::SearchTermsArgs::SearchTermsArgs(const SearchTermsArgs& other) = |
| 157 default; |
| 158 |
156 TemplateURLRef::SearchTermsArgs::~SearchTermsArgs() { | 159 TemplateURLRef::SearchTermsArgs::~SearchTermsArgs() { |
157 } | 160 } |
158 | 161 |
159 TemplateURLRef::SearchTermsArgs::ContextualSearchParams:: | 162 TemplateURLRef::SearchTermsArgs::ContextualSearchParams:: |
160 ContextualSearchParams() | 163 ContextualSearchParams() |
161 : version(-1), | 164 : version(-1), |
162 start(base::string16::npos), | 165 start(base::string16::npos), |
163 end(base::string16::npos), | 166 end(base::string16::npos), |
164 resolve(true) { | 167 resolve(true) { |
165 } | 168 } |
(...skipping 25 matching lines...) Expand all Loading... |
191 : version(version), | 194 : version(version), |
192 start(start), | 195 start(start), |
193 end(end), | 196 end(end), |
194 selection(selection), | 197 selection(selection), |
195 content(content), | 198 content(content), |
196 base_page_url(base_page_url), | 199 base_page_url(base_page_url), |
197 encoding(encoding), | 200 encoding(encoding), |
198 resolve(resolve) { | 201 resolve(resolve) { |
199 } | 202 } |
200 | 203 |
| 204 TemplateURLRef::SearchTermsArgs::ContextualSearchParams::ContextualSearchParams( |
| 205 const ContextualSearchParams& other) = default; |
| 206 |
201 TemplateURLRef::SearchTermsArgs::ContextualSearchParams:: | 207 TemplateURLRef::SearchTermsArgs::ContextualSearchParams:: |
202 ~ContextualSearchParams() { | 208 ~ContextualSearchParams() { |
203 } | 209 } |
204 | 210 |
205 // TemplateURLRef ------------------------------------------------------------- | 211 // TemplateURLRef ------------------------------------------------------------- |
206 | 212 |
207 TemplateURLRef::TemplateURLRef(const TemplateURL* owner, Type type) | 213 TemplateURLRef::TemplateURLRef(const TemplateURL* owner, Type type) |
208 : owner_(owner), | 214 : owner_(owner), |
209 type_(type), | 215 type_(type), |
210 index_in_owner_(0), | 216 index_in_owner_(0), |
(...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1494 // patterns. This means that given patterns | 1500 // patterns. This means that given patterns |
1495 // [ "http://foo/#q={searchTerms}", "http://foo/?q={searchTerms}" ], | 1501 // [ "http://foo/#q={searchTerms}", "http://foo/?q={searchTerms}" ], |
1496 // calling ExtractSearchTermsFromURL() on "http://foo/?q=bar#q=' would | 1502 // calling ExtractSearchTermsFromURL() on "http://foo/?q=bar#q=' would |
1497 // return false. This is important for at least Google, where such URLs | 1503 // return false. This is important for at least Google, where such URLs |
1498 // are invalid. | 1504 // are invalid. |
1499 return !search_terms->empty(); | 1505 return !search_terms->empty(); |
1500 } | 1506 } |
1501 } | 1507 } |
1502 return false; | 1508 return false; |
1503 } | 1509 } |
OLD | NEW |