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

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: Sync to tree for final review. 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 148107)
+++ 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"
@@ -75,7 +80,8 @@
from_previous(match.from_previous),
search_terms_args(match.search_terms_args.get() ?
new TemplateURLRef::SearchTermsArgs(*match.search_terms_args) :
- NULL) {
+ NULL),
+ diagnostics(match.diagnostics) {
}
AutocompleteMatch::~AutocompleteMatch() {
@@ -108,6 +114,7 @@
from_previous = match.from_previous;
search_terms_args.reset(match.search_terms_args.get() ?
new TemplateURLRef::SearchTermsArgs(*match.search_terms_args) : NULL);
+ diagnostics = match.diagnostics;
return *this;
}
@@ -319,6 +326,24 @@
GetTemplateURLForKeyword(keyword);
}
+void AutocompleteMatch::RecordDiagnostic(const std::string& property,
+ const std::string& value) {
+ DCHECK(property.size());
+ DCHECK(value.size());
+ diagnostics[property] = value;
+}
+
+void AutocompleteMatch::RecordDiagnostic(const std::string& property,
+ int value) {
+ RecordDiagnostic(property, StringPrintf("%d", value));
+}
+
+void AutocompleteMatch::RecordDiagnostic(const std::string& property,
+ const base::Time& value) {
+ RecordDiagnostic(property,
+ UTF16ToUTF8(base::TimeFormatShortDateAndTime(value)));
+}
+
#ifndef NDEBUG
void AutocompleteMatch::Validate() const {
ValidateClassifications(contents, contents_class);

Powered by Google App Engine
This is Rietveld 408576698