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 #ifndef CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ |
6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ | 6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // The 0-based position of the cursor within the query string at the time | 89 // The 0-based position of the cursor within the query string at the time |
90 // the request was issued. Set to string16::npos if not used. | 90 // the request was issued. Set to string16::npos if not used. |
91 size_t cursor_position; | 91 size_t cursor_position; |
92 | 92 |
93 // The start-edge margin of the omnibox in pixels, used in extended Instant | 93 // The start-edge margin of the omnibox in pixels, used in extended Instant |
94 // to align the preview contents with the omnibox. | 94 // to align the preview contents with the omnibox. |
95 int omnibox_start_margin; | 95 int omnibox_start_margin; |
96 | 96 |
97 // The URL of the current webpage to be used for experimental zero-prefix | 97 // The URL of the current webpage to be used for experimental zero-prefix |
98 // suggestions. | 98 // suggestions. |
99 std::string zero_prefix_url; | 99 std::string current_page_url; |
100 | 100 |
101 // Which omnibox the user used to type the prefix. | 101 // Which omnibox the user used to type the prefix. |
102 AutocompleteInput::PageClassification page_classification; | 102 AutocompleteInput::PageClassification page_classification; |
103 | 103 |
104 // If set, ReplaceSearchTerms() will automatically append any extra query | 104 // If set, ReplaceSearchTerms() will automatically append any extra query |
105 // params specified via the --extra-search-query-params command-line | 105 // params specified via the --extra-search-query-params command-line |
106 // argument. Generally, this should be set when dealing with the search or | 106 // argument. Generally, this should be set when dealing with the search or |
107 // instant TemplateURLRefs of the default search engine and the caller cares | 107 // instant TemplateURLRefs of the default search engine and the caller cares |
108 // about the query portion of the URL. Since neither TemplateURLRef nor | 108 // about the query portion of the URL. Since neither TemplateURLRef nor |
109 // indeed TemplateURL know whether a TemplateURL is the default search | 109 // indeed TemplateURL know whether a TemplateURL is the default search |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLTwoParameters); | 231 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLTwoParameters); |
232 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLNestedParameter); | 232 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLNestedParameter); |
233 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, URLRefTestImageURLWithPOST); | 233 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, URLRefTestImageURLWithPOST); |
234 | 234 |
235 // Enumeration of the known types. | 235 // Enumeration of the known types. |
236 enum ReplacementType { | 236 enum ReplacementType { |
237 ENCODING, | 237 ENCODING, |
238 GOOGLE_ASSISTED_QUERY_STATS, | 238 GOOGLE_ASSISTED_QUERY_STATS, |
239 GOOGLE_BASE_URL, | 239 GOOGLE_BASE_URL, |
240 GOOGLE_BASE_SUGGEST_URL, | 240 GOOGLE_BASE_SUGGEST_URL, |
| 241 GOOGLE_CURRENT_PAGE_URL, |
241 GOOGLE_CURSOR_POSITION, | 242 GOOGLE_CURSOR_POSITION, |
242 GOOGLE_IMAGE_ORIGINAL_HEIGHT, | 243 GOOGLE_IMAGE_ORIGINAL_HEIGHT, |
243 GOOGLE_IMAGE_ORIGINAL_WIDTH, | 244 GOOGLE_IMAGE_ORIGINAL_WIDTH, |
244 GOOGLE_IMAGE_SEARCH_SOURCE, | 245 GOOGLE_IMAGE_SEARCH_SOURCE, |
245 GOOGLE_IMAGE_THUMBNAIL, | 246 GOOGLE_IMAGE_THUMBNAIL, |
246 GOOGLE_IMAGE_URL, | 247 GOOGLE_IMAGE_URL, |
247 GOOGLE_INSTANT_ENABLED, | 248 GOOGLE_INSTANT_ENABLED, |
248 GOOGLE_INSTANT_EXTENDED_ENABLED, | 249 GOOGLE_INSTANT_EXTENDED_ENABLED, |
249 GOOGLE_NTP_IS_THEMED, | 250 GOOGLE_NTP_IS_THEMED, |
250 GOOGLE_OMNIBOX_START_MARGIN, | 251 GOOGLE_OMNIBOX_START_MARGIN, |
251 GOOGLE_ORIGINAL_QUERY_FOR_SUGGESTION, | 252 GOOGLE_ORIGINAL_QUERY_FOR_SUGGESTION, |
252 GOOGLE_PAGE_CLASSIFICATION, | 253 GOOGLE_PAGE_CLASSIFICATION, |
253 GOOGLE_RLZ, | 254 GOOGLE_RLZ, |
254 GOOGLE_SEARCH_CLIENT, | 255 GOOGLE_SEARCH_CLIENT, |
255 GOOGLE_SEARCH_FIELDTRIAL_GROUP, | 256 GOOGLE_SEARCH_FIELDTRIAL_GROUP, |
256 GOOGLE_SUGGEST_CLIENT, | 257 GOOGLE_SUGGEST_CLIENT, |
257 GOOGLE_UNESCAPED_SEARCH_TERMS, | 258 GOOGLE_UNESCAPED_SEARCH_TERMS, |
258 GOOGLE_ZERO_PREFIX_URL, | |
259 LANGUAGE, | 259 LANGUAGE, |
260 SEARCH_TERMS, | 260 SEARCH_TERMS, |
261 }; | 261 }; |
262 | 262 |
263 // Used to identify an element of the raw url that can be replaced. | 263 // Used to identify an element of the raw url that can be replaced. |
264 struct Replacement { | 264 struct Replacement { |
265 Replacement(ReplacementType type, size_t index) | 265 Replacement(ReplacementType type, size_t index) |
266 : type(type), index(index), is_post_param(false) {} | 266 : type(type), index(index), is_post_param(false) {} |
267 ReplacementType type; | 267 ReplacementType type; |
268 size_t index; | 268 size_t index; |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 TemplateURLRef instant_url_ref_; | 711 TemplateURLRef instant_url_ref_; |
712 TemplateURLRef image_url_ref_; | 712 TemplateURLRef image_url_ref_; |
713 TemplateURLRef new_tab_url_ref_; | 713 TemplateURLRef new_tab_url_ref_; |
714 | 714 |
715 // TODO(sky): Add date last parsed OSD file. | 715 // TODO(sky): Add date last parsed OSD file. |
716 | 716 |
717 DISALLOW_COPY_AND_ASSIGN(TemplateURL); | 717 DISALLOW_COPY_AND_ASSIGN(TemplateURL); |
718 }; | 718 }; |
719 | 719 |
720 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ | 720 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ |
OLD | NEW |