diff options
author | mathp <mathp@chromium.org> | 2016-02-03 07:05:10 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-03 15:06:42 +0000 |
commit | c1d92009a092d41ad0a3c2d84debee4ea5037f36 (patch) | |
tree | 403e99b87d5c95739baa0d26af58e203ed1823d6 | |
parent | 98a34e1189bf20d1872f9e723b44076b0edd45bf (diff) | |
download | chromium_src-c1d92009a092d41ad0a3c2d84debee4ea5037f36.zip chromium_src-c1d92009a092d41ad0a3c2d84debee4ea5037f36.tar.gz chromium_src-c1d92009a092d41ad0a3c2d84debee4ea5037f36.tar.bz2 |
Reland of ll closure compiler and update sources (patchset #1 id:1 of https://codereview.chromium.org/1661853004/ )
Reason for revert:
My revert is breaking the compile
note: Running closure compiler on suggestion_controller.js
note: Running closure compiler on autofill_controller.js
java -jar ../third_party/closure_compiler/compiler/compiler.jar --compilation_level SIMPLE_OPTIMIZATIONS "--jscomp_error=accessControls" "--jscomp_error=ambiguousFunctionDecl" "--jscomp_error=constantProperty" "--jscomp_error=deprecated" "--jscomp_error=externsValidation" "--jscomp_error=globalThis" "--jscomp_error=invalidCasts" "--jscomp_error=nonStandardJsDocs" "--jscomp_error=suspiciousCode" "--jscomp_error=undefinedNames" "--jscomp_error=unknownDefines" "--jscomp_error=uselessCode" "--jscomp_error=visibility" --js "autofill/ios/browser/resources/suggestion_controller.js" --js_output_file "/b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/suggestion_controller.js"
java -jar ../third_party/closure_compiler/compiler/compiler.jar --compilation_level SIMPLE_OPTIMIZATIONS "--jscomp_error=accessControls" "--jscomp_error=ambiguousFunctionDecl" "--jscomp_error=constantProperty" "--jscomp_error=deprecated" "--jscomp_error=externsValidation" "--jscomp_error=globalThis" "--jscomp_error=invalidCasts" "--jscomp_error=nonStandardJsDocs" "--jscomp_error=suspiciousCode" "--jscomp_error=undefinedNames" "--jscomp_error=unknownDefines" "--jscomp_error=uselessCode" "--jscomp_error=visibility" --js "autofill/ios/browser/resources/autofill_controller.js" --js_output_file "/b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/autofill_controller.js"
Error: Invalid or corrupt jarfile ../third_party/closure_compiler/compiler/compiler.jarError: Invalid or corrupt jarfile ../third_party/closure_compiler/compiler/compiler.jar
make: *** [/b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/autofill_controller.js] Error 1
make: *** Waiting for unfinished jobs....
make: *** [/b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/suggestion_controller.js] Error 1
Command /bin/sh failed with exit code 2
Original issue's description:
> Revert of Roll closure compiler and update sources (patchset #6 id:140001 of https://codereview.chromium.org/1473723002/ )
>
> Reason for revert:
> Breaks the FirstRunUIBrowserTest.FirstRunFlow
>
> See the log while it's hot:
> https://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%28dbg%29%281%29/builds/11491/steps/browser_tests/logs/FirstRunUIBrowserTest.FirstRunFlow
>
> Relevant bits:
> ...
> [28690:28690:0202/170602:ERROR:CONSOLE(31)] "Uncaught Error: Assertion failed: [object SVGSVGElement] is not a[n] HTMLElement", source: chrome://resources/js/util.js (31)
> BrowserTestBase signal handler received SIGTERM. Backtrace:
> #0 0x7f32d1d6496e base::debug::StackTrace::StackTrace()
> #1 0x0000024791da content::(anonymous namespace)::DumpStackTraceSignalHandler()
> #2 0x7f32bf3a7150 <unknown>
> #3 0x7f32bf4589d3 __poll
> #4 0x7f32c0142ff6 <unknown>
> ....
>
> Original issue's description:
> > Roll closure compiler and update sources
> >
> > Change log:
> > https://github.com/google/closure-compiler/compare/53f3d8a41579c002ec656bb645ce5d54470f6e0b...972497be96e537b8eee93fbeb367ede9c878df7a
> > chrome_extensions.js: 56292b9c2ae3991e75c0c8d5e86ef91a94058d2e -> a40c181d7d0f0e35ced922d0d8c935821b8ab214
> >
> > Update $() to return HTMLElement.
> > Add a base.getHtmlElement to remoting.
> >
> > BUG=
> > R=dbeam@chromium.org, hirono@chromium.org, jamiewalch@chromium.org, stevenjb@chromium.org
> >
> > Committed: https://chromium.googlesource.com/chromium/src/+/3d7d66a9c117d92000e87d75509bdc12d79aa455
>
> TBR=dbeam@chromium.org,tbreisacher@chromium.org,jamiewalch@chromium.org,mtomasz@chromium.org,hirono@chromium.org,stevenjb@chromium.org,rdevlin.cronin@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=
>
> Committed: https://crrev.com/9f7d03b5af98c508629ed52a18fa222e6996db5f
> Cr-Commit-Position: refs/heads/master@{#373233}
TBR=dbeam@chromium.org,tbreisacher@chromium.org,jamiewalch@chromium.org,mtomasz@chromium.org,hirono@chromium.org,stevenjb@chromium.org,rdevlin.cronin@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=
Review URL: https://codereview.chromium.org/1660373003
Cr-Commit-Position: refs/heads/master@{#373236}
30 files changed, 106 insertions, 66 deletions
diff --git a/chrome/browser/resources/bookmark_manager/js/main.js b/chrome/browser/resources/bookmark_manager/js/main.js index 7dc284f..48e74f2 100644 --- a/chrome/browser/resources/bookmark_manager/js/main.js +++ b/chrome/browser/resources/bookmark_manager/js/main.js @@ -295,7 +295,7 @@ function setSearch(searchText) { * This returns the user visible path to the folder where the bookmark is * located. * @param {number} parentId The ID of the parent folder. - * @return {string} The path to the the bookmark, + * @return {string|undefined} The path to the the bookmark, */ function getFolder(parentId) { var parentNode = bmm.tree.getBookmarkNodeById(parentId); diff --git a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js index 3e3babf..72f6398 100644 --- a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js +++ b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js @@ -780,8 +780,8 @@ Polymer({ * castModeList. * * @param {number} castModeType Type of cast mode to look for. - * @return {?media_router.CastMode} CastMode object with the given type in - * castModeList, or undefined if not found. + * @return {media_router.CastMode|undefined} CastMode object with the given + * type in castModeList, or undefined if not found. */ findCastModeByType_: function(castModeType) { return this.castModeList.find(function(element, index, array) { diff --git a/chrome/browser/resources/options/chromeos/display_options.js b/chrome/browser/resources/options/chromeos/display_options.js index ce93d1f..600451d 100644 --- a/chrome/browser/resources/options/chromeos/display_options.js +++ b/chrome/browser/resources/options/chromeos/display_options.js @@ -346,7 +346,7 @@ cr.define('options', function() { /** * @param {string} id - * @return {options.DisplayInfo} + * @return {!options.DisplayInfo|undefined} */ getDisplayInfoFromId_(id) { return this.displays_.find(function(display) { diff --git a/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js b/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js index c8babf4..47f4efd 100644 --- a/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js +++ b/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js @@ -416,7 +416,7 @@ Polymer({ * @private */ haveDevices_: function(deviceListChanges) { - return this.deviceList.findIndex(function(d) { return d.paired; }) != -1; + return this.deviceList.findIndex(function(d) { return !!d.paired; }) != -1; }, /** diff --git a/remoting/webapp/app_remoting/js/app_connected_view.js b/remoting/webapp/app_remoting/js/app_connected_view.js index f3d05be..6918a1e 100644 --- a/remoting/webapp/app_remoting/js/app_connected_view.js +++ b/remoting/webapp/app_remoting/js/app_connected_view.js @@ -49,7 +49,7 @@ remoting.AppConnectedView = function(containerElement, windowShape, // Initialize the context menus. if (!remoting.platformIsChromeOS()) { menuAdapter = new remoting.ContextMenuDom( - document.getElementById('context-menu'), windowShape); + base.getHtmlElement('context-menu'), windowShape); } this.contextMenu_ = new remoting.ApplicationContextMenu( diff --git a/remoting/webapp/app_remoting/js/app_remoting_activity.js b/remoting/webapp/app_remoting/js/app_remoting_activity.js index b1930bad3..aff04df 100644 --- a/remoting/webapp/app_remoting/js/app_remoting_activity.js +++ b/remoting/webapp/app_remoting/js/app_remoting_activity.js @@ -180,11 +180,11 @@ remoting.AppRemotingActivity.prototype.onAppHostResponse_ = */ remoting.AppRemotingActivity.prototype.onConnected = function(connectionInfo) { var connectedView = new remoting.AppConnectedView( - document.getElementById('client-container'), + base.getHtmlElement('client-container'), this.windowShape_, connectionInfo, this.windowMessageDispatcher_); var idleDetector = new remoting.IdleDetector( - document.getElementById('idle-dialog'), + base.getHtmlElement('idle-dialog'), this.windowShape_, this.app_.getApplicationName(), this.stop.bind(this)); diff --git a/remoting/webapp/base/js/application.js b/remoting/webapp/base/js/application.js index 8fac258..723e0a1 100644 --- a/remoting/webapp/base/js/application.js +++ b/remoting/webapp/base/js/application.js @@ -111,18 +111,25 @@ remoting.Application.prototype.getExtensionInfo = function() { * These functions must be overridden in the subclass. */ -/** @return {string} */ +/** + * @return {string} + * @suppress {missingReturn} + */ remoting.Application.prototype.getApplicationId = function() { console.assert(false, 'Subclass must override'); }; -/** @return {string} */ +/** + * @return {string} + * @suppress {missingReturn} + */ remoting.Application.prototype.getApplicationName = function() { console.assert(false, 'Subclass must override getApplicationName().'); }; /** * @return {remoting.Activity} The Current activity. + * @suppress {missingReturn} */ remoting.Application.prototype.getActivity = function() { console.assert(false, 'Subclass must override getActivity().'); diff --git a/remoting/webapp/base/js/base.js b/remoting/webapp/base/js/base.js index 6f11278..f51181e 100644 --- a/remoting/webapp/base/js/base.js +++ b/remoting/webapp/base/js/base.js @@ -861,3 +861,15 @@ base.isNaclEnabled = function() { } return false; }; + +/** + * Alias for document.getElementById that returns an HTMLElement + * @param {string} id The ID of the element to find. + * @return {?HTMLElement} The found element or null if not found. + */ +base.getHtmlElement = function(id) { + var el = document.getElementById(id); + if (el) + console.assert(el instanceof HTMLElement); + return /** @type {HTMLElement} */(el); +}; diff --git a/remoting/webapp/base/js/message_window.js b/remoting/webapp/base/js/message_window.js index f0eb428..54654ce 100644 --- a/remoting/webapp/base/js/message_window.js +++ b/remoting/webapp/base/js/message_window.js @@ -48,9 +48,9 @@ MessageWindowImpl.prototype.sendReply_ = function( * Initializes the button with the label and the click handler. * Hides the button if the label is null or undefined. * - * @param{HTMLElement} button - * @param{?string} label - * @param{Function} clickHandler + * @param {HTMLElement} button + * @param {?string} label + * @param {Function} clickHandler * @private */ MessageWindowImpl.prototype.initButton_ = @@ -92,12 +92,12 @@ MessageWindowImpl.prototype.onMessage_ = function(event) { } // Set the dialog text. - var button = document.getElementById('button-primary'); - var cancelButton = document.getElementById('button-secondary'); - var messageDiv = document.getElementById('message'); - var infoboxDiv = document.getElementById('infobox'); + var button = base.getHtmlElement('button-primary'); + var cancelButton = base.getHtmlElement('button-secondary'); + var messageDiv = base.getHtmlElement('message'); + var infoboxDiv = base.getHtmlElement('infobox'); - document.getElementById('title').innerText = title; + base.getHtmlElement('title').innerText = title; document.querySelector('title').innerText = title; messageDiv.innerHTML = message; @@ -142,7 +142,7 @@ MessageWindowImpl.prototype.onMessage_ = function(event) { break; } - var messageDiv = document.getElementById('message'); + var messageDiv = base.getHtmlElement('message'); messageDiv.innerText = message; base.resizeWindowToContent(true); diff --git a/remoting/webapp/base/js/modal_dialogs.js b/remoting/webapp/base/js/modal_dialogs.js index e6b750d..4279401 100644 --- a/remoting/webapp/base/js/modal_dialogs.js +++ b/remoting/webapp/base/js/modal_dialogs.js @@ -149,7 +149,6 @@ remoting.MessageDialog.prototype.dispose = function() { /** * @param {remoting.MessageDialog.Result} result - * @return {Function} * @private */ remoting.MessageDialog.prototype.onClicked_ = function(result) { @@ -270,7 +269,7 @@ remoting.ConnectingDialog = function(cancelCallback) { /** @private */ this.dialog_ = new remoting.MessageDialog( remoting.AppMode.CLIENT_CONNECTING, - document.getElementById('cancel-connect-button')); + base.getHtmlElement('cancel-connect-button')); /** @private */ this.onCancel_ = cancelCallback; }; diff --git a/remoting/webapp/browser_test/timeout_waiter.js b/remoting/webapp/browser_test/timeout_waiter.js index cb1a3a4..0c5a35c 100644 --- a/remoting/webapp/browser_test/timeout_waiter.js +++ b/remoting/webapp/browser_test/timeout_waiter.js @@ -70,7 +70,7 @@ browserTest.isVisible = function(id) { var pred = new browserTest.Predicate(); pred.evaluate = function() { /** @type {HTMLElement} */ - var element = document.getElementById(id); + var element = base.getHtmlElement(id); browserTest.expect(Boolean(element), 'No such element: ' + id); return element.getBoundingClientRect().width !== 0; }; diff --git a/remoting/webapp/crd/js/crd_auth_dialog.js b/remoting/webapp/crd/js/crd_auth_dialog.js index 8d45bde..f57c5b3 100644 --- a/remoting/webapp/crd/js/crd_auth_dialog.js +++ b/remoting/webapp/crd/js/crd_auth_dialog.js @@ -67,7 +67,7 @@ remoting.AuthDialog.prototype.isVisible = function() { */ remoting.AuthDialog.getInstance = function() { if (!instance_) { - var rootElement = document.getElementById('auth-dialog'); + var rootElement = base.getHtmlElement('auth-dialog'); instance_ = new remoting.AuthDialog(rootElement); } return instance_; diff --git a/remoting/webapp/crd/js/crd_main.js b/remoting/webapp/crd/js/crd_main.js index d83a1bf..0ce20ae 100644 --- a/remoting/webapp/crd/js/crd_main.js +++ b/remoting/webapp/crd/js/crd_main.js @@ -16,11 +16,11 @@ var remoting = remoting || {}; remoting.initHostlist_ = function(handleConnect) { remoting.hostController = new remoting.HostController(); remoting.hostList = new remoting.HostList( - document.getElementById('host-list'), - document.getElementById('host-list-empty'), - document.getElementById('host-list-error-message'), - document.getElementById('host-list-refresh-failed-button'), - document.getElementById('host-list-loading-indicator'), + base.getHtmlElement('host-list'), + base.getHtmlElement('host-list-empty'), + base.getHtmlElement('host-list-error-message'), + base.getHtmlElement('host-list-refresh-failed-button'), + base.getHtmlElement('host-list-loading-indicator'), remoting.showErrorMessage, handleConnect); @@ -68,13 +68,13 @@ function isHostModeSupported_() { */ remoting.initHomeScreenUi = function() { remoting.setMode(remoting.AppMode.HOME); - var dialog = document.getElementById('paired-clients-list'); - var message = document.getElementById('paired-client-manager-message'); - var deleteAll = document.getElementById('delete-all-paired-clients'); - var close = document.getElementById('close-paired-client-manager-dialog'); - var working = document.getElementById('paired-client-manager-dialog-working'); - var error = document.getElementById('paired-client-manager-dialog-error'); - var noPairedClients = document.getElementById('no-paired-clients'); + var dialog = base.getHtmlElement('paired-clients-list'); + var message = base.getHtmlElement('paired-client-manager-message'); + var deleteAll = base.getHtmlElement('delete-all-paired-clients'); + var close = base.getHtmlElement('close-paired-client-manager-dialog'); + var working = base.getHtmlElement('paired-client-manager-dialog-working'); + var error = base.getHtmlElement('paired-client-manager-dialog-error'); + var noPairedClients = base.getHtmlElement('no-paired-clients'); remoting.pairedClientManager = new remoting.PairedClientManager(remoting.hostController, dialog, message, deleteAll, close, noPairedClients, diff --git a/remoting/webapp/crd/js/desktop_connected_view.js b/remoting/webapp/crd/js/desktop_connected_view.js index 22cbf4b..d06a5a2 100644 --- a/remoting/webapp/crd/js/desktop_connected_view.js +++ b/remoting/webapp/crd/js/desktop_connected_view.js @@ -178,7 +178,7 @@ remoting.DesktopConnectedView.prototype.initUI_ = function() { this.plugin_, this.container_, this.container_.querySelector('.mouse-cursor-overlay')); - var scrollerElement = document.getElementById('scroller'); + var scrollerElement = base.getHtmlElement('scroller'); this.viewport_ = new remoting.DesktopViewport( scrollerElement || document.body, this.plugin_.hostDesktop(), diff --git a/remoting/webapp/crd/js/desktop_remoting.js b/remoting/webapp/crd/js/desktop_remoting.js index 003cef3..3a0157094 100644 --- a/remoting/webapp/crd/js/desktop_remoting.js +++ b/remoting/webapp/crd/js/desktop_remoting.js @@ -96,7 +96,7 @@ remoting.DesktopRemoting.prototype.initApplication_ = function() { if (base.isAppsV2()) { remoting.windowFrame = new remoting.WindowFrame( - document.getElementById('title-bar'), this.disconnect_.bind(this)); + base.getHtmlElement('title-bar'), this.disconnect_.bind(this)); remoting.optionsMenu = remoting.windowFrame.createOptionsMenu(); var START_FULLSCREEN = 'start-fullscreen'; @@ -120,7 +120,7 @@ remoting.DesktopRemoting.prototype.initApplication_ = function() { } else { remoting.fullscreen = new remoting.FullscreenAppsV1(); remoting.toolbar = new remoting.Toolbar( - document.getElementById('session-toolbar'), + base.getHtmlElement('session-toolbar'), this.disconnect_.bind(this)); remoting.optionsMenu = remoting.toolbar.createOptionsMenu(); @@ -133,8 +133,7 @@ remoting.DesktopRemoting.prototype.initApplication_ = function() { document.getElementById('access-mode-button').addEventListener( 'click', this.connectIt2Me_.bind(this), false); - remoting.manageHelpAndFeedback( - document.getElementById('title-bar')); + remoting.manageHelpAndFeedback(base.getHtmlElement('title-bar')); remoting.showOrHideIT2MeUi(); remoting.showOrHideMe2MeUi(); diff --git a/remoting/webapp/crd/js/desktop_remoting_activity.js b/remoting/webapp/crd/js/desktop_remoting_activity.js index 06ebd78..cf516a8 100644 --- a/remoting/webapp/crd/js/desktop_remoting_activity.js +++ b/remoting/webapp/crd/js/desktop_remoting_activity.js @@ -95,7 +95,7 @@ remoting.DesktopRemotingActivity.prototype.onConnected = } this.connectedView_ = remoting.DesktopConnectedView.create( - document.getElementById('client-container'), connectionInfo); + base.getHtmlElement('client-container'), connectionInfo); // Apply the default or previously-specified keyboard remapping. var remapping = connectionInfo.host().options.getRemapKeys(); diff --git a/remoting/webapp/crd/js/host_table_entry.js b/remoting/webapp/crd/js/host_table_entry.js index 89845a0..d5bae00 100644 --- a/remoting/webapp/crd/js/host_table_entry.js +++ b/remoting/webapp/crd/js/host_table_entry.js @@ -134,7 +134,7 @@ remoting.HostTableEntry.prototype.createDom_ = function() { } }; -/** @return {base.Disposable} @private */ +/** @private */ remoting.HostTableEntry.prototype.registerButton_ = function( /** HTMLElement */ button, /** Function */ callback) { var onKeyDown = function(/** Event */ e) { diff --git a/remoting/webapp/crd/js/it2me_activity.js b/remoting/webapp/crd/js/it2me_activity.js index 1e69c63..3d4e102 100644 --- a/remoting/webapp/crd/js/it2me_activity.js +++ b/remoting/webapp/crd/js/it2me_activity.js @@ -24,7 +24,7 @@ remoting.It2MeActivity = function() { /** @private */ this.passCode_ = ''; - var form = document.getElementById('access-code-form'); + var form = base.getHtmlElement('access-code-form'); /** @private */ this.accessCodeDialog_ = remoting.modalDialogFactory.createInputDialog( remoting.AppMode.CLIENT_UNCONNECTED, @@ -151,7 +151,7 @@ remoting.It2MeActivity.prototype.getDesktopActivityForTesting = function() { remoting.It2MeActivity.prototype.showFinishDialog_ = function(mode) { var finishDialog = new remoting.MessageDialog( mode, - document.getElementById('client-finished-it2me-button')); + base.getHtmlElement('client-finished-it2me-button')); finishDialog.show().then(function() { remoting.setMode(remoting.AppMode.HOME); }); diff --git a/remoting/webapp/crd/js/me2me_activity.js b/remoting/webapp/crd/js/me2me_activity.js index d2bcbdc..aa43d8a 100644 --- a/remoting/webapp/crd/js/me2me_activity.js +++ b/remoting/webapp/crd/js/me2me_activity.js @@ -23,10 +23,10 @@ remoting.Me2MeActivity = function(host, hostList) { this.hostList_ = hostList; /** @private */ this.pinDialog_ = - new remoting.PinDialog(document.getElementById('pin-dialog'), host); + new remoting.PinDialog(base.getHtmlElement('pin-dialog'), host); /** @private */ this.hostUpdateDialog_ = new remoting.HostNeedsUpdateDialog( - document.getElementById('host-needs-update-dialog'), this.host_); + base.getHtmlElement('host-needs-update-dialog'), this.host_); /** @private */ this.retryOnHostOffline_ = true; @@ -282,8 +282,8 @@ remoting.Me2MeActivity.prototype.showErrorMessage_ = function(error) { remoting.Me2MeActivity.prototype.showFinishDialog_ = function(mode) { var dialog = remoting.modalDialogFactory.createMessageDialog( mode, - document.getElementById('client-finished-me2me-button'), - document.getElementById('client-reconnect-button')); + base.getHtmlElement('client-finished-me2me-button'), + base.getHtmlElement('client-reconnect-button')); /** @typedef {remoting.MessageDialog.Result} */ var Result = remoting.MessageDialog.Result; diff --git a/remoting/webapp/crd/js/third_party_host_permissions.js b/remoting/webapp/crd/js/third_party_host_permissions.js index 1fd3edf..e8bc2d4 100644 --- a/remoting/webapp/crd/js/third_party_host_permissions.js +++ b/remoting/webapp/crd/js/third_party_host_permissions.js @@ -66,9 +66,9 @@ remoting.ThirdPartyHostPermissions.prototype.getPermission = function( remoting.ThirdPartyHostPermissions.prototype.showPermissionConfirmation_ = function(onOk, onError) { /** @type {HTMLElement} */ - var button = document.getElementById('third-party-auth-button'); + var button = base.getHtmlElement('third-party-auth-button'); /** @type {HTMLElement} */ - var url = document.getElementById('third-party-auth-url'); + var url = base.getHtmlElement('third-party-auth-url'); url.innerText = this.url_; /** @type {remoting.ThirdPartyHostPermissions} */ diff --git a/remoting/webapp/crd/js/xhr_proxy.js b/remoting/webapp/crd/js/xhr_proxy.js index 42ff883..dd24d7d 100644 --- a/remoting/webapp/crd/js/xhr_proxy.js +++ b/remoting/webapp/crd/js/xhr_proxy.js @@ -65,10 +65,12 @@ remoting.XMLHttpRequestProxy.prototype.abort = function() { } }; +/** @suppress {missingReturn} */ remoting.XMLHttpRequestProxy.prototype.getResponseHeader = function(header) { console.error('Sandbox: unproxied getResponseHeader(' + header + ') called.'); }; +/** @suppress {missingReturn} */ remoting.XMLHttpRequestProxy.prototype.getAllResponseHeaders = function() { console.error('Sandbox: unproxied getAllResponseHeaders called.'); }; diff --git a/remoting/webapp/js_proto/dom_proto.js b/remoting/webapp/js_proto/dom_proto.js index c47c990..58b48c0 100644 --- a/remoting/webapp/js_proto/dom_proto.js +++ b/remoting/webapp/js_proto/dom_proto.js @@ -54,9 +54,6 @@ Element.prototype.offsetBottom; /** @type {string} */ Element.prototype.textContent; -/** @type {DOMTokenList} */ -Element.prototype.classList; - /** @type {boolean} */ Element.prototype.checked; diff --git a/third_party/closure_compiler/README.chromium b/third_party/closure_compiler/README.chromium index 86a8278..1a04bbd 100644 --- a/third_party/closure_compiler/README.chromium +++ b/third_party/closure_compiler/README.chromium @@ -3,7 +3,7 @@ Short Name: closure-compiler URL: http://github.com/google/closure-compiler Version: v20150729-236-gad656a1 Date: 2015/08/26 08:46 -Revision: 53f3d8a41579c002ec656bb645ce5d54470f6e0b +Revision: 972497be96e537b8eee93fbeb367ede9c878df7a License: Apache 2.0 License File: LICENSE Security Critical: no diff --git a/third_party/closure_compiler/externs/chrome_extensions.js b/third_party/closure_compiler/externs/chrome_extensions.js index 787e808..656a6a7 100644 --- a/third_party/closure_compiler/externs/chrome_extensions.js +++ b/third_party/closure_compiler/externs/chrome_extensions.js @@ -6,7 +6,7 @@ // S:::::S T:::::T O:::::O O:::::O P::::P P:::::P // S::::SSSS P::::PPPPPP:::::P // SS::::::SSSSS This file is generated. To update it, P:::::::::::::PP -// SSS::::::::SS run roll_compiler_version. P::::PPPPPPPPP +// SSS::::::::SS run roll_closure_compiler. P::::PPPPPPPPP // SSSSSS::::S P::::P // S:::::S T:::::T O:::::O O:::::O P::::P // S:::::S T:::::T O::::::O O::::::O P::::P @@ -403,14 +403,14 @@ chrome.app.window.AppWindow.prototype.hide = function() {}; /** - * @return {!chrome.app.window.Bounds} The current window bounds. + * @return {!chrome.app.window.ContentBounds} The current window bounds. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow */ chrome.app.window.AppWindow.prototype.getBounds = function() {}; /** - * @param {!chrome.app.window.Bounds} bounds The new window bounds. + * @param {!chrome.app.window.ContentBounds} bounds The new window bounds. * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow */ chrome.app.window.AppWindow.prototype.setBounds = function(bounds) {}; @@ -431,6 +431,24 @@ chrome.app.window.AppWindow.prototype.isAlwaysOnTop = function() {}; chrome.app.window.AppWindow.prototype.setAlwaysOnTop = function(alwaysOnTop) {}; +/** + * @param {boolean} alwaysVisible Set whether the window is visible on all + * workspaces. + * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow + */ +chrome.app.window.AppWindow.prototype.setVisibleOnAllWorkspaces = + function(alwaysVisible) {}; + + +/** + * @param {boolean} wantAllKeys Set whether the window should get all keyboard + * events including system keys that are usually not sent. + * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow + */ +chrome.app.window.AppWindow.prototype.setInterceptAllKeys = + function(wantAllKeys) {}; + + /** @type {!ChromeEvent} */ chrome.app.window.AppWindow.prototype.onBoundsChanged; @@ -459,6 +477,10 @@ chrome.app.window.AppWindow.prototype.onRestored; chrome.app.window.AppWindow.prototype.contentWindow; +/** @type {string} */ +chrome.app.window.AppWindow.prototype.id; + + /** @type {!chrome.app.window.Bounds} */ chrome.app.window.AppWindow.prototype.innerBounds; diff --git a/third_party/closure_compiler/runner/runner.jar b/third_party/closure_compiler/runner/runner.jar Binary files differindex a7f5f52..2f4542b 100644 --- a/third_party/closure_compiler/runner/runner.jar +++ b/third_party/closure_compiler/runner/runner.jar diff --git a/ui/file_manager/file_manager/foreground/js/import_controller.js b/ui/file_manager/file_manager/foreground/js/import_controller.js index 3e06bfe..73b7f7c 100644 --- a/ui/file_manager/file_manager/foreground/js/import_controller.js +++ b/ui/file_manager/file_manager/foreground/js/import_controller.js @@ -516,7 +516,8 @@ importer.ClickSource = { importer.RuntimeCommandWidget = function() { /** @private {HTMLElement} */ - this.detailsPanel_ = document.getElementById('cloud-import-details'); + this.detailsPanel_ = /** @type {HTMLElement} */( + document.getElementById('cloud-import-details')); this.detailsPanel_.addEventListener( 'transitionend', this.onDetailsTransitionEnd_.bind(this), diff --git a/ui/file_manager/file_manager/foreground/js/ui/banners.js b/ui/file_manager/file_manager/foreground/js/ui/banners.js index cf6c4d9..8d19ac0 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/banners.js +++ b/ui/file_manager/file_manager/foreground/js/ui/banners.js @@ -213,7 +213,7 @@ Banners.prototype.prepareAndShowWelcomeBanner_ = function(type, messageId) { more.href = str('GOOGLE_DRIVE_REDEEM_URL'); var moreInnerButton = util.createChild( more, 'imitate-paper-button primary', 'button'); - moreInnerButton.tabIndex = '-1'; + moreInnerButton.tabIndex = -1; moreInnerButton.textContent = str('DRIVE_WELCOME_CHECK_ELIGIBILITY'); } else { title.textContent = str('DRIVE_WELCOME_TITLE'); @@ -221,7 +221,7 @@ Banners.prototype.prepareAndShowWelcomeBanner_ = function(type, messageId) { more.textContent = str('DRIVE_LEARN_MORE'); more.href = str('GOOGLE_DRIVE_OVERVIEW_URL'); } - more.tabIndex = '21'; // See: go/filesapp-tabindex. + more.tabIndex = 21; // See: go/filesapp-tabindex. more.id = 'drive-welcome-link'; more.target = '_blank'; diff --git a/ui/file_manager/file_manager/foreground/js/ui/search_box.js b/ui/file_manager/file_manager/foreground/js/ui/search_box.js index ff52ec5..e56aa4c 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/search_box.js +++ b/ui/file_manager/file_manager/foreground/js/ui/search_box.js @@ -239,7 +239,7 @@ SearchBox.prototype.onKeyDown_ = function(event) { if (event.keyIdentifier != 'U+001B' /* Esc */ || this.inputElement.value) return; - this.inputElement.tabIndex = '-1'; // Focus to default element after blur. + this.inputElement.tabIndex = -1; // Focus to default element after blur. this.inputElement.blur(); }; @@ -275,8 +275,8 @@ SearchBox.prototype.updateStyles_ = function() { var hasFocusOnInput = this.element.classList.contains('has-cursor'); // See go/filesapp-tabindex for tabindexes. - this.inputElement.tabIndex = (hasText || hasFocusOnInput) ? '13' : '-1'; - this.searchButton.tabIndex = (hasText || hasFocusOnInput) ? '-1' : '12'; + this.inputElement.tabIndex = (hasText || hasFocusOnInput) ? 13 : -1; + this.searchButton.tabIndex = (hasText || hasFocusOnInput) ? -1 : 12; }; /** diff --git a/ui/webui/resources/js/compiled_resources.gyp b/ui/webui/resources/js/compiled_resources.gyp index cbfeab6..6646ce1 100644 --- a/ui/webui/resources/js/compiled_resources.gyp +++ b/ui/webui/resources/js/compiled_resources.gyp @@ -32,7 +32,7 @@ { 'target_name': 'util', 'variables': { - 'depends': ['compiled_resources.gyp:cr'], + 'depends': ['compiled_resources.gyp:cr', 'assert.js'], # TODO(jlklein): Get <(VARIABLES) in transient externs/depends working. 'externs': ['../../../../third_party/closure_compiler/externs/chrome_send.js'], }, diff --git a/ui/webui/resources/js/util.js b/ui/webui/resources/js/util.js index 3907c52..d67bd72 100644 --- a/ui/webui/resources/js/util.js +++ b/ui/webui/resources/js/util.js @@ -5,12 +5,13 @@ // <include src="assert.js"> /** - * Alias for document.getElementById. + * Alias for document.getElementById. Found elements must be HTMLElements. * @param {string} id The ID of the element to find. * @return {HTMLElement} The found element or null if not found. */ function $(id) { - return document.getElementById(id); + var el = document.getElementById(id); + return el ? assertInstanceof(el, HTMLElement) : null; } /** |