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

Unified Diff: chrome/browser/autocomplete/autocomplete_match.h

Issue 10692075: Enhance chrome://omnibox Presentation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Add braces. Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_match.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_match.h
===================================================================
--- chrome/browser/autocomplete/autocomplete_match.h (revision 148107)
+++ chrome/browser/autocomplete/autocomplete_match.h (working copy)
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_
#define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_
+#include <map>
#include <string>
#include <vector>
@@ -17,6 +18,10 @@
class Profile;
class TemplateURL;
+namespace base {
+class Time;
+} // namespace base
+
// AutocompleteMatch ----------------------------------------------------------
// A single result line with classified spans. The autocomplete popup displays
@@ -64,6 +69,10 @@
typedef std::vector<ACMatchClassification> ACMatchClassifications;
+ // Type used by providers to attach additional, optional information to
+ // an AutocompleteMatch.
+ typedef std::map<std::string, std::string> AdditionalInfo;
+
// The type of this match.
enum Type {
URL_WHAT_YOU_TYPED = 0, // The input as a URL.
@@ -189,6 +198,13 @@
// TemplateURL. See comments on |keyword| below.
TemplateURL* GetTemplateURL(Profile* profile) const;
+ // Adds optional information to the |additional_info| dictionary.
+ void RecordAdditionalInfo(const std::string& property,
+ const std::string& value);
+ void RecordAdditionalInfo(const std::string& property, int value);
+ void RecordAdditionalInfo(const std::string& property,
+ const base::Time& value);
+
// The provider of this match, used to remember which provider the user had
// selected when the input changes. This may be NULL, in which case there is
// no provider (or memory of the user's selection).
@@ -283,6 +299,10 @@
// AutocompleteController to do no additional transformations.
scoped_ptr<TemplateURLRef::SearchTermsArgs> search_terms_args;
+ // Information dictionary into which each provider can optionally record a
+ // property and associated value and which is presented in chrome://omnibox.
+ AdditionalInfo additional_info;
+
#ifndef NDEBUG
// Does a data integrity check on this match.
void Validate() const;
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_match.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698