Chromium Code Reviews| Index: chrome/browser/resources/omnibox/omnibox.js |
| =================================================================== |
| --- chrome/browser/resources/omnibox/omnibox.js (revision 148107) |
| +++ 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,32 +85,50 @@ |
| * @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, |
| + 'A green checkmark indicates that the result has been bookmarked.'), |
| 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, |
| + 'A green checkmark indicates that the result is an History What You ' + |
| + 'Typed Match'), |
| + new PresentationInfoRecord('Description', '', 'description', false, |
| + 'The page title of the result.'), |
| + 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 result 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, |
| + 'A green checkmark indicates that the results can be deleted from ' + |
| + 'the visit history.'), |
| + new PresentationInfoRecord('Prev', '', 'from_previous', false, ''), |
| 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, |
| + 'A green checkmark indicates that the provider is done looking for ' + |
| + 'more results.'), |
| new PresentationInfoRecord( |
| - 'Template URL', '', 'template_url', false), |
| + 'Template URL', '', 'template_url', false, ''), |
| new PresentationInfoRecord( |
| - 'Associated Keyword', '', 'associated_keyword', false) |
| + 'Associated Keyword', '', 'associated_keyword', false, ''), |
| + new PresentationInfoRecord( |
| + 'Diagnostics', '', 'diagnostics', false, |
| + 'Provider-specific information about the result.') |
| ]; |
| /** |
| @@ -131,6 +153,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); |
| } |
| @@ -150,7 +173,25 @@ |
| propertyName) { |
| var cell = document.createElement('td'); |
| if (propertyName in autocompleteSuggestion) { |
| - if (typeof autocompleteSuggestion[propertyName] == 'boolean') { |
| + if (propertyName == 'diagnostics') { |
| + // |diagnostics| embeds a two-column table of provider-specific data |
| + // within this cell. |
| + var diagnostic_table = document.createElement('table'); |
|
arv (Not doing code reviews)
2012/07/26 21:02:00
no underscores in js
mrossetti
2012/07/26 23:17:13
Done throughout.
|
| + for (var diagnostic_key in autocompleteSuggestion[propertyName]) { |
| + var diagnostic_row = document.createElement('tr'); |
| + var property_cell = document.createElement('td'); |
| + property_cell.textContent = diagnostic_key + ':'; |
| + 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]) { |