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

Side by Side Diff: components/omnibox/browser/search_suggestion_parser.h

Issue 2755503002: Add a new entry to omnibox_event.proto to log specific type of contextual suggestions (Closed)
Patch Set: Moved the logging of the specific type in the omnibox_event proto. Created 3 years, 9 months 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
OLDNEW
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 #ifndef COMPONENTS_OMNIBOX_BROWSER_SEARCH_SUGGESTION_PARSER_H_ 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_SEARCH_SUGGESTION_PARSER_H_
6 #define COMPONENTS_OMNIBOX_BROWSER_SEARCH_SUGGESTION_PARSER_H_ 6 #define COMPONENTS_OMNIBOX_BROWSER_SEARCH_SUGGESTION_PARSER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 class NavigationResult : public Result { 194 class NavigationResult : public Result {
195 public: 195 public:
196 NavigationResult(const AutocompleteSchemeClassifier& scheme_classifier, 196 NavigationResult(const AutocompleteSchemeClassifier& scheme_classifier,
197 const GURL& url, 197 const GURL& url,
198 AutocompleteMatchType::Type type, 198 AutocompleteMatchType::Type type,
199 const base::string16& description, 199 const base::string16& description,
200 const std::string& deletion_url, 200 const std::string& deletion_url,
201 bool from_keyword_provider, 201 bool from_keyword_provider,
202 int relevance, 202 int relevance,
203 bool relevance_from_server, 203 bool relevance_from_server,
204 const base::string16& input_text); 204 const base::string16& input_text,
205 int specific_type_identifier);
206 NavigationResult(const NavigationResult& nav);
205 ~NavigationResult() override; 207 ~NavigationResult() override;
206 208
207 const GURL& url() const { return url_; } 209 const GURL& url() const { return url_; }
208 const base::string16& description() const { return description_; } 210 const base::string16& description() const { return description_; }
209 const base::string16& formatted_url() const { return formatted_url_; } 211 const base::string16& formatted_url() const { return formatted_url_; }
212 int specific_type_identifier() const { return specific_type_identifier_; }
210 213
211 // Fills in |match_contents_| and |match_contents_class_| to reflect how 214 // Fills in |match_contents_| and |match_contents_class_| to reflect how
212 // the URL should be displayed and bolded against the current |input_text|. 215 // the URL should be displayed and bolded against the current |input_text|.
213 // If |allow_bolding_nothing| is false and |match_contents_class_| would 216 // If |allow_bolding_nothing| is false and |match_contents_class_| would
214 // result in an entirely unbolded |match_contents_|, do nothing. 217 // result in an entirely unbolded |match_contents_|, do nothing.
215 void CalculateAndClassifyMatchContents(const bool allow_bolding_nothing, 218 void CalculateAndClassifyMatchContents(const bool allow_bolding_nothing,
216 const base::string16& input_text); 219 const base::string16& input_text);
217 220
218 // Result: 221 // Result:
219 int CalculateRelevance(const AutocompleteInput& input, 222 int CalculateRelevance(const AutocompleteInput& input,
220 bool keyword_provider_requested) const override; 223 bool keyword_provider_requested) const override;
221 224
222 private: 225 private:
223 // The suggested url for navigation. 226 // The suggested url for navigation.
224 GURL url_; 227 GURL url_;
225 228
226 // The properly formatted ("fixed up") URL string with equivalent meaning 229 // The properly formatted ("fixed up") URL string with equivalent meaning
227 // to the one in |url_|. 230 // to the one in |url_|.
228 base::string16 formatted_url_; 231 base::string16 formatted_url_;
229 232
230 // The suggested navigational result description; generally the site name. 233 // The suggested navigational result description; generally the site name.
231 base::string16 description_; 234 base::string16 description_;
235
236 // If this suggestion is a zero suggest suggestion, this will be set to the
237 // specific subtype of the result.
238 int specific_type_identifier_;
232 }; 239 };
233 240
234 typedef std::vector<SuggestResult> SuggestResults; 241 typedef std::vector<SuggestResult> SuggestResults;
235 typedef std::vector<NavigationResult> NavigationResults; 242 typedef std::vector<NavigationResult> NavigationResults;
236 243
237 // A simple structure bundling most of the information (including 244 // A simple structure bundling most of the information (including
238 // both SuggestResults and NavigationResults) returned by a call to 245 // both SuggestResults and NavigationResults) returned by a call to
239 // the suggest server. 246 // the suggest server.
240 // 247 //
241 // This has to be declared after the typedefs since it relies on some of them. 248 // This has to be declared after the typedefs since it relies on some of them.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 const AutocompleteSchemeClassifier& scheme_classifier, 304 const AutocompleteSchemeClassifier& scheme_classifier,
298 int default_result_relevance, 305 int default_result_relevance,
299 bool is_keyword_result, 306 bool is_keyword_result,
300 Results* results); 307 Results* results);
301 308
302 private: 309 private:
303 DISALLOW_COPY_AND_ASSIGN(SearchSuggestionParser); 310 DISALLOW_COPY_AND_ASSIGN(SearchSuggestionParser);
304 }; 311 };
305 312
306 #endif // COMPONENTS_OMNIBOX_BROWSER_SEARCH_SUGGESTION_PARSER_H_ 313 #endif // COMPONENTS_OMNIBOX_BROWSER_SEARCH_SUGGESTION_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698