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

Unified Diff: chrome/browser/resources/omnibox/omnibox.js

Issue 10692075: Enhance chrome://omnibox Presentation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: We\'re not logging\! We\'re recording diagnostics\! 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/resources/omnibox/omnibox.js
===================================================================
--- chrome/browser/resources/omnibox/omnibox.js (revision 145893)
+++ chrome/browser/resources/omnibox/omnibox.js (working copy)
@@ -63,13 +63,17 @@
* result record that we lookup.
* @param {boolean} displayAlways whether the property should be displayed
* regardless of whether we're in detailed more.
+ * @param {string} tooltip a description of the property that will be
+ * presented as a tooltip when the mouse is hovered over the column title.
* @constructor
*/
- function PresentationInfoRecord(header, url, propertyName, displayAlways) {
+ function PresentationInfoRecord(header, url, propertyName, displayAlways,
+ tooltip) {
this.header = header;
this.urlLabelForHeader = url;
this.propertyName = propertyName;
this.displayAlways = displayAlways;
+ this.tooltip = tooltip;
}
/**
@@ -81,30 +85,46 @@
* @const
*/
var PROPERTY_OUTPUT_ORDER = [
- new PresentationInfoRecord('Provider', '', 'provider_name', true),
- new PresentationInfoRecord('Type', '', 'type', true),
- new PresentationInfoRecord('Relevance', '', 'relevance', true),
- new PresentationInfoRecord('Contents', '', 'contents', true),
- new PresentationInfoRecord('Starred', '', 'starred', false),
+ new PresentationInfoRecord('Provider', '', 'provider_name', true,
+ 'The AutocompleteProvider suggesting this result.'),
+ new PresentationInfoRecord('Type', '', 'type', true,
+ 'The type of the result.'),
+ new PresentationInfoRecord('Relevance', '', 'relevance', true,
+ 'The result score. Higher is more relevant.'),
+ new PresentationInfoRecord('Contents', '', 'contents', true,
+ 'The text that is presented identifying the result.'),
+ new PresentationInfoRecord('Starred', '', 'starred', false,
+ 'If checked the result has been bookmarked.'),
Mark P 2012/07/10 19:41:12 Optional nit: sometimes below the tooltips are If
mrossetti 2012/07/14 02:34:06 Done.
new PresentationInfoRecord(
- 'Is History What You Typed Match', '',
- 'is_history_what_you_typed_match', false),
- new PresentationInfoRecord('Description', '', 'description', false),
- new PresentationInfoRecord('URL', '', 'destination_url', true),
- new PresentationInfoRecord('Fill Into Edit', '', 'fill_into_edit', false),
+ 'HWYT', '', 'is_history_what_you_typed_match', false,
+ 'If checked the result is an History What You Typed Match'),
+ new PresentationInfoRecord('Description', '', 'description', false,
+ 'The page title or suggestion provider name.'),
Mark P 2012/07/10 19:41:12 This doesn't seem accurate.
mrossetti 2012/07/14 02:34:06 Fixed.
+ new PresentationInfoRecord('URL', '', 'destination_url', true,
+ 'The URL for the result.'),
+ new PresentationInfoRecord('Fill Into Edit', '', 'fill_into_edit', false,
+ 'The text shown in the omnibox when the suggestion is selected.'),
new PresentationInfoRecord(
- 'Inline Autocomplete Offset', '', 'inline_autocomplete_offset', false),
- new PresentationInfoRecord('Deletable', '', 'deletable', false),
- new PresentationInfoRecord('From Previous', '', 'from_previous', false),
+ 'IAO', '', 'inline_autocomplete_offset', false,
+ 'The Inline Autocomplete Offset.'),
+ new PresentationInfoRecord('Del', '', 'deletable', false,
+ 'Checked when the results can be deleted from the visit history.'),
+ new PresentationInfoRecord('Prev', '', 'from_previous', false,
+ 'A green checkmkark indicates that the result was'),
Mark P 2012/07/10 19:41:12 This doesn't actually say much of anything.
mrossetti 2012/07/14 02:34:06 I actually don't know what this column means so I
new PresentationInfoRecord(
- 'Transition Type',
+ 'Tran',
'http://code.google.com/codesearch#OAMlx_jo-ck/src/content/public/' +
'common/page_transition_types.h&exact_package=chromium&l=24',
- 'transition', false),
+ 'transition', false,
+ 'How the user got to the result.'),
new PresentationInfoRecord(
- 'Is This Provider Done', '', 'provider_done', false),
+ 'Done', '', 'provider_done', false,
+ 'Checked when the provider is done looking for more suggestions.'),
new PresentationInfoRecord(
- 'Template URL', '', 'template_url', false)
+ 'Template URL', '', 'template_url', false, ''),
+ new PresentationInfoRecord(
+ 'Diagnostics', '', 'diagnostics', false,
+ 'Provider-specific information about each suggestion.')
Mark P 2012/07/10 19:41:12 I'd prefer result instead of suggestion here. Act
mrossetti 2012/07/14 02:34:06 Done.
];
/**
@@ -129,6 +149,7 @@
// Output header text without a URL.
headerCell.textContent = PROPERTY_OUTPUT_ORDER[i].header;
headerCell.className = 'table-header';
+ headerCell.title = PROPERTY_OUTPUT_ORDER[i].tooltip;
}
row.appendChild(headerCell);
}
@@ -148,7 +169,24 @@
propertyName) {
var cell = document.createElement('td');
if (propertyName in autocompleteSuggestion) {
- if (typeof autocompleteSuggestion[propertyName] == 'boolean') {
+ if (propertyName == 'diagnostics') {
+ // |diagnostics| presents a two-column table of provider-specific data.
Mark P 2012/07/10 19:41:12 Perhaps: presents -> embeds and append: within thi
mrossetti 2012/07/14 02:34:06 Done.
+ var diagnostic_table = document.createElement('table');
+ for (var diagnostic_key in autocompleteSuggestion[propertyName]) {
+ var diagnostic_row = document.createElement('tr');
+ var property_cell = document.createElement('td');
+ property_cell.textContent = diagnostic_key + ':';
Mark P 2012/07/10 19:41:12 Does the ':' add to readability of the table?
mrossetti 2012/07/14 02:34:06 Yes.
+ property_cell.className = 'diagnostic-property';
+ diagnostic_row.appendChild(property_cell);
+ var value_cell = document.createElement('td');
+ value_cell.textContent =
+ autocompleteSuggestion[propertyName][diagnostic_key];
+ value_cell.className = 'diagnostic-value';
+ diagnostic_row.appendChild(value_cell);
+ diagnostic_table.appendChild(diagnostic_row);
+ }
+ cell.appendChild(diagnostic_table);
+ } else if (typeof autocompleteSuggestion[propertyName] == 'boolean') {
// If this is a boolean, display a checkmark or an X instead of
// the strings true or false.
if (autocompleteSuggestion[propertyName]) {

Powered by Google App Engine
This is Rietveld 408576698