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

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

Issue 2600683002: Run tools/clang-format-js on some of chrome/browser/resources/ (Closed)
Patch Set: hackhackhack Created 3 years, 11 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
diff --git a/chrome/browser/resources/omnibox/omnibox.js b/chrome/browser/resources/omnibox/omnibox.js
index 2570deb46d9d758f4244614d8b4da7fe751ee3bf..b8dc2c96989c4726305f51a1a99e69c8f9e19f07 100644
--- a/chrome/browser/resources/omnibox/omnibox.js
+++ b/chrome/browser/resources/omnibox/omnibox.js
@@ -22,10 +22,10 @@
* Register our event handlers.
*/
function initialize() {
- $('omnibox-input-form').addEventListener(
- 'submit', startOmniboxQuery, false);
- $('prevent-inline-autocomplete').addEventListener(
- 'change', startOmniboxQuery);
+ $('omnibox-input-form')
+ .addEventListener('submit', startOmniboxQuery, false);
+ $('prevent-inline-autocomplete')
+ .addEventListener('change', startOmniboxQuery);
$('prefer-keyword').addEventListener('change', startOmniboxQuery);
$('page-classification').addEventListener('change', startOmniboxQuery);
$('show-details').addEventListener('change', refresh);
@@ -64,10 +64,8 @@
// - fifth element: the value of page-classification
cursorPositionUsed = $('input-text').selectionEnd;
browserProxy.startOmniboxQuery(
- $('input-text').value,
- cursorPositionUsed,
- $('prevent-inline-autocomplete').checked,
- $('prefer-keyword').checked,
+ $('input-text').value, cursorPositionUsed,
+ $('prevent-inline-autocomplete').checked, $('prefer-keyword').checked,
parseInt($('page-classification').value));
// Cancel the submit action. i.e., don't submit the form. (We handle
// display the results solely with Javascript.)
@@ -88,8 +86,8 @@
* presented as a tooltip when the mouse is hovered over the column title.
* @constructor
*/
- function PresentationInfoRecord(header, url, propertyName, displayAlways,
- tooltip) {
+ function PresentationInfoRecord(
+ header, url, propertyName, displayAlways, tooltip) {
this.header = header;
this.urlLabelForHeader = url;
this.propertyName = propertyName;
@@ -106,56 +104,62 @@
* @const
*/
var PROPERTY_OUTPUT_ORDER = [
- new PresentationInfoRecord('Provider', '', 'provider_name', true,
+ 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,
+ 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,
+ new PresentationInfoRecord(
+ 'Contents', '', 'contents', true,
'The text that is presented identifying the result.'),
new PresentationInfoRecord(
'Can Be Default', '', 'allowed_to_be_default_match', false,
'A green checkmark indicates that the result can be the default ' +
- 'match (i.e., can be the match that pressing enter in the omnibox ' +
- 'navigates to).'),
- new PresentationInfoRecord('Starred', '', 'starred', false,
+ 'match (i.e., can be the match that pressing enter in the ' +
+ 'omnibox navigates to).'),
+ new PresentationInfoRecord(
+ 'Starred', '', 'starred', false,
'A green checkmark indicates that the result has been bookmarked.'),
- new PresentationInfoRecord('Description', '', 'description', false,
+ 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,
+ 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 Autocompletion', '', 'inline_autocompletion', false,
'The text shown in the omnibox as a blue highlight selection ' +
- 'following the cursor, if this match is shown inline.'),
- new PresentationInfoRecord('Del', '', 'deletable', false,
+ 'following the cursor, if this match is shown inline.'),
+ new PresentationInfoRecord(
+ 'Del', '', 'deletable', false,
'A green checkmark indicates that the result can be deleted from ' +
- 'the visit history.'),
+ 'the visit history.'),
new PresentationInfoRecord('Prev', '', 'from_previous', false, ''),
new PresentationInfoRecord(
'Tran',
'http://code.google.com/codesearch#OAMlx_jo-ck/src/content/public/' +
- 'common/page_transition_types.h&exact_package=chromium&l=24',
- 'transition', false,
- 'How the user got to the result.'),
+ 'common/page_transition_types.h&exact_package=chromium&l=24',
+ 'transition', false, 'How the user got to the result.'),
new PresentationInfoRecord(
'Done', '', 'provider_done', false,
'A green checkmark indicates that the provider is done looking for ' +
- 'more results.'),
+ 'more results.'),
new PresentationInfoRecord(
'Associated Keyword', '', 'associated_keyword', false,
'If non-empty, a "press tab to search" hint will be shown and will ' +
- 'engage this keyword.'),
+ 'engage this keyword.'),
new PresentationInfoRecord(
'Keyword', '', 'keyword', false,
'The keyword of the search engine to be used.'),
new PresentationInfoRecord(
'Duplicates', '', 'duplicates', false,
'The number of matches that have been marked as duplicates of this ' +
- 'match.'),
+ 'match.'),
new PresentationInfoRecord(
'Additional Info', '', 'additional_info', false,
'Provider-specific information about the result.')
@@ -199,8 +203,8 @@
* @return {HTMLTableCellElement} that contains the value within this
* autocompleteSuggestion associated with propertyName.
*/
- function createCellForPropertyAndRemoveProperty(autocompleteSuggestion,
- propertyName) {
+ function createCellForPropertyAndRemoveProperty(
+ autocompleteSuggestion, propertyName) {
var cell = document.createElement('td');
if (propertyName in autocompleteSuggestion) {
if (propertyName == 'additional_info') {
@@ -280,8 +284,8 @@
// batch of results.
if (inDetailedMode || showIncompleteResults) {
var p1 = document.createElement('p');
- p1.textContent = 'elapsed time = ' +
- result.time_since_omnibox_started_ms + 'ms';
+ p1.textContent =
+ 'elapsed time = ' + result.time_since_omnibox_started_ms + 'ms';
output.appendChild(p1);
var p2 = document.createElement('p');
p2.textContent = 'all providers done = ' + result.done;
@@ -291,8 +295,8 @@
if ('is_typed_host' in result) {
// Only output the is_typed_host information if available. (It may
// be missing if the history database lookup failed.)
- p3.textContent = p3.textContent + ' has is_typed_host = ' +
- result.is_typed_host;
+ p3.textContent =
+ p3.textContent + ' has is_typed_host = ' + result.is_typed_host;
}
output.appendChild(p3);
}
@@ -399,8 +403,8 @@
if (progressiveAutocompleteResults.length > 0) { // if we have results
// Display the results.
var showIncompleteResults = $('show-incomplete-results').checked;
- var startIndex = showIncompleteResults ? 0 :
- progressiveAutocompleteResults.length - 1;
+ var startIndex =
+ showIncompleteResults ? 0 : progressiveAutocompleteResults.length - 1;
for (var i = startIndex; i < progressiveAutocompleteResults.length; i++) {
addResultToOutput(progressiveAutocompleteResults[i]);
}
@@ -415,33 +419,35 @@
function initializeProxies() {
return importModules([
- 'mojo/public/js/bindings',
- 'chrome/browser/ui/webui/omnibox/omnibox.mojom',
- 'content/public/renderer/frame_interfaces',
- ]).then(function(modules) {
- var bindings = modules[0];
- var mojom = modules[1];
- var frameInterfaces = modules[2];
-
- browserProxy = new mojom.OmniboxPageHandlerPtr(
- frameInterfaces.getInterface(mojom.OmniboxPageHandler.name));
-
- /** @constructor */
- var OmniboxPageImpl = function() {
- this.binding = new bindings.Binding(mojom.OmniboxPage, this);
- };
-
- OmniboxPageImpl.prototype = {
- /** @override */
- handleNewAutocompleteResult: function(result) {
- progressiveAutocompleteResults.push(result);
- refresh();
- },
- };
-
- pageImpl = new OmniboxPageImpl();
- browserProxy.setClientPage(pageImpl.binding.createInterfacePtrAndBind());
- });
+ 'mojo/public/js/bindings',
+ 'chrome/browser/ui/webui/omnibox/omnibox.mojom',
+ 'content/public/renderer/frame_interfaces',
+ ])
+ .then(function(modules) {
+ var bindings = modules[0];
+ var mojom = modules[1];
+ var frameInterfaces = modules[2];
+
+ browserProxy = new mojom.OmniboxPageHandlerPtr(
+ frameInterfaces.getInterface(mojom.OmniboxPageHandler.name));
+
+ /** @constructor */
+ var OmniboxPageImpl = function() {
+ this.binding = new bindings.Binding(mojom.OmniboxPage, this);
+ };
+
+ OmniboxPageImpl.prototype = {
+ /** @override */
+ handleNewAutocompleteResult: function(result) {
+ progressiveAutocompleteResults.push(result);
+ refresh();
+ },
+ };
+
+ pageImpl = new OmniboxPageImpl();
+ browserProxy.setClientPage(
+ pageImpl.binding.createInterfacePtrAndBind());
+ });
}
document.addEventListener('DOMContentLoaded', function() {

Powered by Google App Engine
This is Rietveld 408576698