Commit ec0c24cb authored by Scott Chen's avatar Scott Chen Committed by Commit Bot

NUX Onboarding: fix closure annotations.

This CL preemptively fixes closure annotations for all NUX-related JS
files, there will be a follow-up CL to actually enable closure compiling
on these files.

Bug: 874151
Change-Id: I67d56d7b0cffc2c8fa8134c03bf748eaaf79c376
Reviewed-on: https://chromium-review.googlesource.com/1256362
Commit-Queue: Scott Chen <scottchen@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595707}
parent 25a3837e
......@@ -8,11 +8,11 @@
var nuxEmail = nuxEmail || {};
/**
* @typedef {{
* @typedef {?{
* name: string,
* icon: string,
* url: string,
* bookmarkId: {string|undefined},
* bookmarkId: (string|undefined),
* }}
*/
nuxEmail.EmailProviderModel;
......@@ -42,7 +42,7 @@ Polymer({
},
},
/** @private {NuxEmailProxy} */
/** @private {nux.NuxEmailProxy} */
browserProxy_: null,
/** @override */
......@@ -110,7 +110,7 @@ Polymer({
},
/**
* @param {nuxEmail.EmailProviderModel=} newEmail
* @param {nuxEmail.EmailProviderModel=} emailProvider
* @private
*/
revertBookmark_: function(emailProvider) {
......
......@@ -37,6 +37,15 @@ cr.define('nux', function() {
const INTERACTION_METRIC_COUNT =
Object.keys(NuxEmailProvidersInteractions).length;
/**
* @typedef {{
* parentId: string,
* title: string,
* url: string,
* }}
*/
let bookmarkData;
/** @interface */
class NuxEmailProxy {
/** @param {string} id ID provided by callback when bookmark was added. */
......@@ -74,8 +83,16 @@ cr.define('nux', function() {
recordFinalize() {}
}
/** @implements {NuxEmailProxy} */
/** @implements {nux.NuxEmailProxy} */
class NuxEmailProxyImpl {
constructor() {
/** @private {string} */
this.firstPart = '';
/** @private {string} */
this.lastPart = '';
}
/** @override */
removeBookmark(id) {
chrome.bookmarks.remove(id);
......
......@@ -86,7 +86,10 @@ Polymer({
this.hasAppsSelected = this.computeHasAppsSelected_();
},
/** @private {boolean} */
/**
* @return {boolean}
* @private
*/
computeHasAppsSelected_: function() {
return this.appList.some(a => a.selected);
},
......
......@@ -12,7 +12,7 @@ cr.define('nux', function() {
addGoogleApps(selectedApps) {}
}
/** @implements {NuxGoogleAppsProxy} */
/** @implements {nux.NuxGoogleAppsProxy} */
class NuxGoogleAppsProxyImpl {
/** @override */
addGoogleApps(selectedApps) {
......
......@@ -54,7 +54,7 @@ cr.define('welcome', function() {
// Notifies all the elements that extended NavigationBehavior.
function notifyObservers() {
const route = history.state.route;
const route = /** @type {!welcome.Routes} */ (history.state.route);
const step = history.state.step;
routeObservers.forEach((observer) => {
observer.onRouteChange(route, step);
......@@ -73,7 +73,9 @@ cr.define('welcome', function() {
// history state was set when page loaded, so when the element first
// attaches, call the route-change handler to initialize first.
this.onRouteChange(history.state.route, history.state.step);
this.onRouteChange(
/** @type {!welcome.Routes} */ (history.state.route),
history.state.step);
},
/** @override */
......@@ -95,7 +97,7 @@ cr.define('welcome', function() {
},
/**
* @param {string} route
* @param {!welcome.Routes} route
* @param {number} step
*/
navigateTo: function(route, step) {
......
......@@ -8,7 +8,7 @@ cr.define('nux', function() {
setAsDefault() {}
}
/** @implements {NuxSetAsDefaultProxy} */
/** @implements {nux.NuxSetAsDefaultProxy} */
class NuxSetAsDefaultProxyImpl {
/** @override */
setAsDefault() {
......
......@@ -27,7 +27,7 @@ Polymer({
},
/**
* @param {string} route
* @param {welcome.Routes} route
* @param {number} step
* @private
*/
......@@ -46,6 +46,7 @@ Polymer({
this.$.viewManager.switchView('step-' + step);
},
/** @param {!Array<string>} modules Array of valid DOM element names. */
initializeModules: function(modules) {
assert(this.currentRoute_); // this.currentRoute_ should be set by now.
if (this.currentRoute_ == welcome.Routes.LANDING)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment