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

Side by Side Diff: components/omnibox/autocomplete_match.h

Issue 669573005: Add a class to parse answer json. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix case on "copyright" Created 6 years, 1 month 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
« no previous file with comments | « components/omnibox/BUILD.gn ('k') | components/omnibox/autocomplete_match.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_AUTOCOMPLETE_MATCH_H_ 5 #ifndef COMPONENTS_OMNIBOX_AUTOCOMPLETE_MATCH_H_
6 #define COMPONENTS_OMNIBOX_AUTOCOMPLETE_MATCH_H_ 6 #define COMPONENTS_OMNIBOX_AUTOCOMPLETE_MATCH_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "components/omnibox/autocomplete_match_type.h" 13 #include "components/omnibox/autocomplete_match_type.h"
14 #include "components/search_engines/template_url.h" 14 #include "components/search_engines/template_url.h"
15 #include "ui/base/page_transition_types.h" 15 #include "ui/base/page_transition_types.h"
16 #include "url/gurl.h" 16 #include "url/gurl.h"
17 17
18 class AutocompleteProvider; 18 class AutocompleteProvider;
19 class SuggestionAnswer;
19 class TemplateURL; 20 class TemplateURL;
20 class TemplateURLService; 21 class TemplateURLService;
21 22
22 namespace base { 23 namespace base {
23 class Time; 24 class Time;
24 } // namespace base 25 } // namespace base
25 26
26 const char kACMatchPropertyInputText[] = "input text"; 27 const char kACMatchPropertyInputText[] = "input text";
27 const char kACMatchPropertyContentsPrefix[] = "match contents prefix"; 28 const char kACMatchPropertyContentsPrefix[] = "match contents prefix";
28 const char kACMatchPropertyContentsStartIndex[] = "match contents start index"; 29 const char kACMatchPropertyContentsStartIndex[] = "match contents start index";
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 GURL stripped_destination_url; 311 GURL stripped_destination_url;
311 312
312 // The main text displayed in the address bar dropdown. 313 // The main text displayed in the address bar dropdown.
313 base::string16 contents; 314 base::string16 contents;
314 ACMatchClassifications contents_class; 315 ACMatchClassifications contents_class;
315 316
316 // Additional helper text for each entry, such as a title or description. 317 // Additional helper text for each entry, such as a title or description.
317 base::string16 description; 318 base::string16 description;
318 ACMatchClassifications description_class; 319 ACMatchClassifications description_class;
319 320
321 // TODO(jdonnelly): Remove the first two properties once the downstream
322 // clients are using the SuggestionAnswer.
320 // A rich-format version of the display for the dropdown. 323 // A rich-format version of the display for the dropdown.
321 base::string16 answer_contents; 324 base::string16 answer_contents;
322 base::string16 answer_type; 325 base::string16 answer_type;
326 scoped_ptr<SuggestionAnswer> answer;
323 327
324 // The transition type to use when the user opens this match. By default 328 // The transition type to use when the user opens this match. By default
325 // this is TYPED. Providers whose matches do not look like URLs should set 329 // this is TYPED. Providers whose matches do not look like URLs should set
326 // it to GENERATED. 330 // it to GENERATED.
327 ui::PageTransition transition; 331 ui::PageTransition transition;
328 332
329 // True when this match is the "what you typed" match from the history 333 // True when this match is the "what you typed" match from the history
330 // system. 334 // system.
331 bool is_history_what_you_typed_match; 335 bool is_history_what_you_typed_match;
332 336
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 const base::string16& text, 384 const base::string16& text,
381 const ACMatchClassifications& classifications) const; 385 const ACMatchClassifications& classifications) const;
382 #endif 386 #endif
383 }; 387 };
384 388
385 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; 389 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification;
386 typedef std::vector<ACMatchClassification> ACMatchClassifications; 390 typedef std::vector<ACMatchClassification> ACMatchClassifications;
387 typedef std::vector<AutocompleteMatch> ACMatches; 391 typedef std::vector<AutocompleteMatch> ACMatches;
388 392
389 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_MATCH_H_ 393 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_MATCH_H_
OLDNEW
« no previous file with comments | « components/omnibox/BUILD.gn ('k') | components/omnibox/autocomplete_match.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698