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

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

Issue 10692075: Enhance chrome://omnibox Presentation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Tweak layout so that Logged Info does not wrap. 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
Index: chrome/browser/autocomplete/autocomplete_match.cc
===================================================================
--- chrome/browser/autocomplete/autocomplete_match.cc (revision 145689)
+++ chrome/browser/autocomplete/autocomplete_match.cc (working copy)
@@ -4,9 +4,14 @@
#include "chrome/browser/autocomplete/autocomplete_match.h"
+#include "base/i18n/time_formatting.h"
#include "base/logging.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
+#include "base/string16.h"
+#include "base/stringprintf.h"
+#include "base/time.h"
+#include "base/utf_string_conversions.h"
#include "chrome/browser/autocomplete/autocomplete_provider.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_service.h"
@@ -76,7 +81,8 @@
from_previous(match.from_previous),
search_terms_args(match.search_terms_args.get() ?
new TemplateURLRef::SearchTermsArgs(*match.search_terms_args) :
- NULL) {
+ NULL),
+ info_log(match.info_log) {
}
AutocompleteMatch::~AutocompleteMatch() {
@@ -109,6 +115,7 @@
from_previous = match.from_previous;
search_terms_args.reset(match.search_terms_args.get() ?
new TemplateURLRef::SearchTermsArgs(*match.search_terms_args) : NULL);
+ info_log = match.info_log;
return *this;
}
@@ -320,6 +327,22 @@
GetTemplateURLForKeyword(keyword);
}
+void AutocompleteMatch::LogInfo(const std::string& title,
+ const std::string& value) {
+ DCHECK(title.size());
+ DCHECK(value.size());
+ info_log[title] = value;
+}
+
+void AutocompleteMatch::LogInfo(const std::string& title, int value) {
+ LogInfo(title, StringPrintf("%d", value));
+}
+
+void AutocompleteMatch::LogInfo(const std::string& title,
+ const base::Time& value) {
+ LogInfo(title, UTF16ToUTF8(base::TimeFormatShortDateAndTime(value)));
+}
+
#ifndef NDEBUG
void AutocompleteMatch::Validate() const {
ValidateClassifications(contents, contents_class);

Powered by Google App Engine
This is Rietveld 408576698