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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // The 0-based position of the cursor within the query string at the time | 90 // The 0-based position of the cursor within the query string at the time |
91 // the request was issued. Set to string16::npos if not used. | 91 // the request was issued. Set to string16::npos if not used. |
92 size_t cursor_position; | 92 size_t cursor_position; |
93 | 93 |
94 // The start-edge margin of the omnibox in pixels, used in extended Instant | 94 // The start-edge margin of the omnibox in pixels, used in extended Instant |
95 // to align the preview contents with the omnibox. | 95 // to align the preview contents with the omnibox. |
96 int omnibox_start_margin; | 96 int omnibox_start_margin; |
97 | 97 |
98 // The URL of the current webpage to be used for experimental zero-prefix | 98 // The URL of the current webpage to be used for experimental zero-prefix |
99 // suggestions. | 99 // suggestions. |
100 std::string zero_prefix_url; | 100 std::string current_page_url; |
101 | 101 |
102 // Which omnibox the user used to type the prefix. | 102 // Which omnibox the user used to type the prefix. |
103 AutocompleteInput::PageClassification page_classification; | 103 AutocompleteInput::PageClassification page_classification; |
104 | 104 |
105 // True for searches issued with the bookmark bar pref set to shown. | 105 // True for searches issued with the bookmark bar pref set to shown. |
106 bool bookmark_bar_pinned; | 106 bool bookmark_bar_pinned; |
107 | 107 |
108 // Additional query params provided by the suggest server. | 108 // Additional query params provided by the suggest server. |
109 std::string suggest_query_params; | 109 std::string suggest_query_params; |
110 | 110 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, URLRefTestImageURLWithPOST); | 246 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, URLRefTestImageURLWithPOST); |
247 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ReflectsBookmarkBarPinned); | 247 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ReflectsBookmarkBarPinned); |
248 | 248 |
249 // Enumeration of the known types. | 249 // Enumeration of the known types. |
250 enum ReplacementType { | 250 enum ReplacementType { |
251 ENCODING, | 251 ENCODING, |
252 GOOGLE_ASSISTED_QUERY_STATS, | 252 GOOGLE_ASSISTED_QUERY_STATS, |
253 GOOGLE_BASE_URL, | 253 GOOGLE_BASE_URL, |
254 GOOGLE_BASE_SUGGEST_URL, | 254 GOOGLE_BASE_SUGGEST_URL, |
255 GOOGLE_BOOKMARK_BAR_PINNED, | 255 GOOGLE_BOOKMARK_BAR_PINNED, |
| 256 GOOGLE_CURRENT_PAGE_URL, |
256 GOOGLE_CURSOR_POSITION, | 257 GOOGLE_CURSOR_POSITION, |
257 GOOGLE_IMAGE_ORIGINAL_HEIGHT, | 258 GOOGLE_IMAGE_ORIGINAL_HEIGHT, |
258 GOOGLE_IMAGE_ORIGINAL_WIDTH, | 259 GOOGLE_IMAGE_ORIGINAL_WIDTH, |
259 GOOGLE_IMAGE_SEARCH_SOURCE, | 260 GOOGLE_IMAGE_SEARCH_SOURCE, |
260 GOOGLE_IMAGE_THUMBNAIL, | 261 GOOGLE_IMAGE_THUMBNAIL, |
261 GOOGLE_IMAGE_URL, | 262 GOOGLE_IMAGE_URL, |
262 GOOGLE_FORCE_INSTANT_RESULTS, | 263 GOOGLE_FORCE_INSTANT_RESULTS, |
263 GOOGLE_INSTANT_EXTENDED_ENABLED, | 264 GOOGLE_INSTANT_EXTENDED_ENABLED, |
264 GOOGLE_NTP_IS_THEMED, | 265 GOOGLE_NTP_IS_THEMED, |
265 GOOGLE_OMNIBOX_START_MARGIN, | 266 GOOGLE_OMNIBOX_START_MARGIN, |
266 GOOGLE_ORIGINAL_QUERY_FOR_SUGGESTION, | 267 GOOGLE_ORIGINAL_QUERY_FOR_SUGGESTION, |
267 GOOGLE_PAGE_CLASSIFICATION, | 268 GOOGLE_PAGE_CLASSIFICATION, |
268 GOOGLE_RLZ, | 269 GOOGLE_RLZ, |
269 GOOGLE_SEARCH_CLIENT, | 270 GOOGLE_SEARCH_CLIENT, |
270 GOOGLE_SEARCH_FIELDTRIAL_GROUP, | 271 GOOGLE_SEARCH_FIELDTRIAL_GROUP, |
271 GOOGLE_SUGGEST_CLIENT, | 272 GOOGLE_SUGGEST_CLIENT, |
272 GOOGLE_UNESCAPED_SEARCH_TERMS, | 273 GOOGLE_UNESCAPED_SEARCH_TERMS, |
273 GOOGLE_ZERO_PREFIX_URL, | |
274 LANGUAGE, | 274 LANGUAGE, |
275 SEARCH_TERMS, | 275 SEARCH_TERMS, |
276 }; | 276 }; |
277 | 277 |
278 // Used to identify an element of the raw url that can be replaced. | 278 // Used to identify an element of the raw url that can be replaced. |
279 struct Replacement { | 279 struct Replacement { |
280 Replacement(ReplacementType type, size_t index) | 280 Replacement(ReplacementType type, size_t index) |
281 : type(type), index(index), is_post_param(false) {} | 281 : type(type), index(index), is_post_param(false) {} |
282 ReplacementType type; | 282 ReplacementType type; |
283 size_t index; | 283 size_t index; |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 TemplateURLRef image_url_ref_; | 760 TemplateURLRef image_url_ref_; |
761 TemplateURLRef new_tab_url_ref_; | 761 TemplateURLRef new_tab_url_ref_; |
762 scoped_ptr<AssociatedExtensionInfo> extension_info_; | 762 scoped_ptr<AssociatedExtensionInfo> extension_info_; |
763 | 763 |
764 // TODO(sky): Add date last parsed OSD file. | 764 // TODO(sky): Add date last parsed OSD file. |
765 | 765 |
766 DISALLOW_COPY_AND_ASSIGN(TemplateURL); | 766 DISALLOW_COPY_AND_ASSIGN(TemplateURL); |
767 }; | 767 }; |
768 | 768 |
769 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ | 769 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ |
OLD | NEW |