| Index: chrome/browser/resources/uber/uber.js
|
| diff --git a/chrome/browser/resources/uber/uber.js b/chrome/browser/resources/uber/uber.js
|
| index 2d44c7b278c6f80cbcaeb8f48b9e39279f658d59..01123cde27f4b7928ba7d6e1edcfd8167efcd8ac 100644
|
| --- a/chrome/browser/resources/uber/uber.js
|
| +++ b/chrome/browser/resources/uber/uber.js
|
| @@ -7,9 +7,9 @@ cr.define('uber', function() {
|
| * Options for how web history should be handled.
|
| */
|
| var HISTORY_STATE_OPTION = {
|
| - PUSH: 1, // Push a new history state.
|
| - REPLACE: 2, // Replace the current history state.
|
| - NONE: 3, // Ignore this history state change.
|
| + PUSH: 1, // Push a new history state.
|
| + REPLACE: 2, // Replace the current history state.
|
| + NONE: 3, // Ignore this history state change.
|
| };
|
|
|
| /**
|
| @@ -81,8 +81,8 @@ cr.define('uber', function() {
|
| var container = $(params.id);
|
| if (container) {
|
| // The id is valid. Add the hash and search parts of the URL to path.
|
| - params.path = (params.path || '') + window.location.search +
|
| - window.location.hash;
|
| + params.path =
|
| + (params.path || '') + window.location.search + window.location.hash;
|
| } else {
|
| // The target sub-page does not exist, discard the params we generated.
|
| params.id = undefined;
|
| @@ -115,8 +115,8 @@ cr.define('uber', function() {
|
| // Note: This assumes that the state and path parameters for every page
|
| // under this origin are compatible. All of the downstream pages which
|
| // navigate use pushState and replaceState.
|
| - invokeMethodOnPage(params.id, 'popState',
|
| - {state: e.state, path: '/' + params.path});
|
| + invokeMethodOnPage(
|
| + params.id, 'popState', {state: e.state, path: '/' + params.path});
|
| }
|
|
|
| /**
|
| @@ -156,7 +156,7 @@ cr.define('uber', function() {
|
| * @param {Event} e The posted object.
|
| */
|
| function handleWindowMessage(e) {
|
| - e = /** @type {!MessageEvent<!{method: string, params: *}>} */(e);
|
| + e = /** @type {!MessageEvent<!{method: string, params: *}>} */ (e);
|
| if (e.data.method === 'beginInterceptingEvents') {
|
| backgroundNavigation();
|
| } else if (e.data.method === 'stopInterceptingEvents') {
|
| @@ -164,20 +164,20 @@ cr.define('uber', function() {
|
| } else if (e.data.method === 'ready') {
|
| pageReady(e.origin);
|
| } else if (e.data.method === 'updateHistory') {
|
| - updateHistory(e.origin, e.data.params.state, e.data.params.path,
|
| - e.data.params.replace);
|
| + updateHistory(
|
| + e.origin, e.data.params.state, e.data.params.path,
|
| + e.data.params.replace);
|
| } else if (e.data.method === 'setTitle') {
|
| setTitle(e.origin, e.data.params.title);
|
| } else if (e.data.method === 'showPage') {
|
| - showPage(e.data.params.pageId,
|
| - HISTORY_STATE_OPTION.PUSH,
|
| - e.data.params.path);
|
| + showPage(
|
| + e.data.params.pageId, HISTORY_STATE_OPTION.PUSH, e.data.params.path);
|
| } else if (e.data.method === 'navigationControlsLoaded') {
|
| onNavigationControlsLoaded();
|
| } else if (e.data.method === 'adjustToScroll') {
|
| - adjustToScroll(/** @type {number} */(e.data.params));
|
| + adjustToScroll(/** @type {number} */ (e.data.params));
|
| } else if (e.data.method === 'mouseWheel') {
|
| - forwardMouseWheel(/** @type {Object} */(e.data.params));
|
| + forwardMouseWheel(/** @type {Object} */ (e.data.params));
|
| } else if (e.data.method === 'mouseDown') {
|
| forwardMouseDown();
|
| } else {
|
| @@ -212,8 +212,8 @@ cr.define('uber', function() {
|
| navFrame.classList[enabled ? 'add' : 'remove']('changing-content');
|
|
|
| if (isRTL()) {
|
| - uber.invokeMethodOnWindow(navFrame.firstChild.contentWindow,
|
| - 'setContentChanging', enabled);
|
| + uber.invokeMethodOnWindow(
|
| + navFrame.firstChild.contentWindow, 'setContentChanging', enabled);
|
| }
|
| }
|
|
|
| @@ -227,7 +227,7 @@ cr.define('uber', function() {
|
| var query = '.iframe-container > iframe[src^="' + origin + '/"]';
|
| var element = document.querySelector(query);
|
| assert(element);
|
| - return /** @type {!Element} */(element);
|
| + return /** @type {!Element} */ (element);
|
| }
|
|
|
| /**
|
| @@ -387,7 +387,7 @@ cr.define('uber', function() {
|
| document.title = container.dataset.title;
|
| assert('favicon' in container.dataset);
|
|
|
| - var dataset = /** @type {{favicon: string}} */(container.dataset);
|
| + var dataset = /** @type {{favicon: string}} */ (container.dataset);
|
| $('favicon').href = 'chrome://theme/' + dataset.favicon;
|
| $('favicon2x').href = 'chrome://theme/' + dataset.favicon + '@2x';
|
|
|
| @@ -404,8 +404,9 @@ cr.define('uber', function() {
|
| */
|
| function updateNavigationControls() {
|
| var container = getSelectedIframeContainer();
|
| - uber.invokeMethodOnWindow(navFrame.firstChild.contentWindow,
|
| - 'changeSelection', {pageId: container.id});
|
| + uber.invokeMethodOnWindow(
|
| + navFrame.firstChild.contentWindow, 'changeSelection',
|
| + {pageId: container.id});
|
| }
|
|
|
| /**
|
| @@ -420,9 +421,8 @@ cr.define('uber', function() {
|
| setContentChanging(false);
|
|
|
| if (isRTL()) {
|
| - uber.invokeMethodOnWindow(navFrame.firstChild.contentWindow,
|
| - 'adjustToScroll',
|
| - scrollOffset);
|
| + uber.invokeMethodOnWindow(
|
| + navFrame.firstChild.contentWindow, 'adjustToScroll', scrollOffset);
|
| var navWidth = Math.max(0, +navFrame.dataset.width + scrollOffset);
|
| navFrame.style.width = navWidth + 'px';
|
| } else {
|
| @@ -466,10 +466,7 @@ cr.define('uber', function() {
|
| }
|
| }
|
|
|
| - return {
|
| - onLoad: onLoad,
|
| - onPopHistoryState: onPopHistoryState
|
| - };
|
| + return {onLoad: onLoad, onPopHistoryState: onPopHistoryState};
|
| });
|
|
|
| window.addEventListener('popstate', uber.onPopHistoryState);
|
|
|