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

Side by Side Diff: chrome/browser/search_engines/template_url.h

Issue 11414303: Make Google Search autocomplete provider cursor aware. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Addressed comments. Created 8 years 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 (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 <vector> 9 #include <vector>
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // The optional assisted query stats, aka AQS, used for logging purposes. 63 // The optional assisted query stats, aka AQS, used for logging purposes.
64 // This string contains impressions of all autocomplete matches shown 64 // This string contains impressions of all autocomplete matches shown
65 // at the query submission time. For privacy reasons, we require the 65 // at the query submission time. For privacy reasons, we require the
66 // search provider to support HTTPS protocol in order to receive the AQS 66 // search provider to support HTTPS protocol in order to receive the AQS
67 // param. 67 // param.
68 // For more details, see http://goto.google.com/binary-clients-logging . 68 // For more details, see http://goto.google.com/binary-clients-logging .
69 std::string assisted_query_stats; 69 std::string assisted_query_stats;
70 70
71 // TODO: Remove along with "aq" CGI param. 71 // TODO: Remove along with "aq" CGI param.
72 int accepted_suggestion; 72 int accepted_suggestion;
73
74 // The 0-based position of the cursor within the query string at the time
75 // the request was issued. Set to string16::npos if not used or after the
76 // last character.
77 size_t cursor_position;
73 }; 78 };
74 79
75 TemplateURLRef(TemplateURL* owner, Type type); 80 TemplateURLRef(TemplateURL* owner, Type type);
76 TemplateURLRef(TemplateURL* owner, size_t index_in_owner); 81 TemplateURLRef(TemplateURL* owner, size_t index_in_owner);
77 ~TemplateURLRef(); 82 ~TemplateURLRef();
78 83
79 // Returns the raw URL. None of the parameters will have been replaced. 84 // Returns the raw URL. None of the parameters will have been replaced.
80 std::string GetURL() const; 85 std::string GetURL() const;
81 86
82 // Returns true if this URL supports replacement. 87 // Returns true if this URL supports replacement.
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLTwoParameters); 155 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLTwoParameters);
151 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLNestedParameter); 156 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLNestedParameter);
152 157
153 // Enumeration of the known types. 158 // Enumeration of the known types.
154 enum ReplacementType { 159 enum ReplacementType {
155 ENCODING, 160 ENCODING,
156 GOOGLE_ACCEPTED_SUGGESTION, 161 GOOGLE_ACCEPTED_SUGGESTION,
157 GOOGLE_ASSISTED_QUERY_STATS, 162 GOOGLE_ASSISTED_QUERY_STATS,
158 GOOGLE_BASE_URL, 163 GOOGLE_BASE_URL,
159 GOOGLE_BASE_SUGGEST_URL, 164 GOOGLE_BASE_SUGGEST_URL,
165 GOOGLE_CURSOR_POSITION,
160 GOOGLE_INSTANT_ENABLED, 166 GOOGLE_INSTANT_ENABLED,
161 GOOGLE_ORIGINAL_QUERY_FOR_SUGGESTION, 167 GOOGLE_ORIGINAL_QUERY_FOR_SUGGESTION,
162 GOOGLE_RLZ, 168 GOOGLE_RLZ,
163 GOOGLE_SEARCH_FIELDTRIAL_GROUP, 169 GOOGLE_SEARCH_FIELDTRIAL_GROUP,
164 GOOGLE_UNESCAPED_SEARCH_TERMS, 170 GOOGLE_UNESCAPED_SEARCH_TERMS,
165 LANGUAGE, 171 LANGUAGE,
166 SEARCH_TERMS, 172 SEARCH_TERMS,
167 }; 173 };
168 174
169 // Used to identify an element of the raw url that can be replaced. 175 // Used to identify an element of the raw url that can be replaced.
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 TemplateURLRef url_ref_; 493 TemplateURLRef url_ref_;
488 TemplateURLRef suggestions_url_ref_; 494 TemplateURLRef suggestions_url_ref_;
489 TemplateURLRef instant_url_ref_; 495 TemplateURLRef instant_url_ref_;
490 496
491 // TODO(sky): Add date last parsed OSD file. 497 // TODO(sky): Add date last parsed OSD file.
492 498
493 DISALLOW_COPY_AND_ASSIGN(TemplateURL); 499 DISALLOW_COPY_AND_ASSIGN(TemplateURL);
494 }; 500 };
495 501
496 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ 502 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698