Chromium Code Reviews| Index: chrome/browser/resources/omnibox/omnibox.js |
| =================================================================== |
| --- chrome/browser/resources/omnibox/omnibox.js (revision 145689) |
| +++ 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. |
|
Mark P
2012/07/10 14:51:34
Please mention hover here.
mrossetti
2012/07/10 17:57:08
Done.
|
| * @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 results.'), |
|
Mark P
2012/07/10 14:51:34
results -> result ?
mrossetti
2012/07/10 17:57:08
Done.
|
| + 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.'), |
| 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.'), |
| + 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'), |
| 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( |
| + 'Logged Info', '', 'log_info', false, |
| + 'Provider-specific information about each suggestion.') |
| ]; |
| /** |
| @@ -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 == 'log_info') { |
| + // |log_info| presents a two-column table of provider-specific data. |
| + var log_table = document.createElement('table'); |
| + for (var log_key in autocompleteSuggestion[propertyName]) { |
| + var log_row = document.createElement('tr'); |
| + var title_cell = document.createElement('td'); |
| + title_cell.textContent = log_key + ':'; |
| + title_cell.className = 'logged-title'; |
| + log_row.appendChild(title_cell); |
| + var value_cell = document.createElement('td'); |
| + value_cell.textContent = |
| + autocompleteSuggestion[propertyName][log_key]; |
| + value_cell.className = 'logged-value'; |
| + log_row.appendChild(value_cell); |
| + log_table.appendChild(log_row); |
| + } |
| + cell.appendChild(log_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]) { |