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 @@ ...@@ -8,11 +8,11 @@
var nuxEmail = nuxEmail || {}; var nuxEmail = nuxEmail || {};
/** /**
* @typedef {{ * @typedef {?{
* name: string, * name: string,
* icon: string, * icon: string,
* url: string, * url: string,
* bookmarkId: {string|undefined}, * bookmarkId: (string|undefined),
* }} * }}
*/ */
nuxEmail.EmailProviderModel; nuxEmail.EmailProviderModel;
...@@ -42,7 +42,7 @@ Polymer({ ...@@ -42,7 +42,7 @@ Polymer({
}, },
}, },
/** @private {NuxEmailProxy} */ /** @private {nux.NuxEmailProxy} */
browserProxy_: null, browserProxy_: null,
/** @override */ /** @override */
...@@ -110,7 +110,7 @@ Polymer({ ...@@ -110,7 +110,7 @@ Polymer({
}, },
/** /**
* @param {nuxEmail.EmailProviderModel=} newEmail * @param {nuxEmail.EmailProviderModel=} emailProvider
* @private * @private
*/ */
revertBookmark_: function(emailProvider) { revertBookmark_: function(emailProvider) {
......
...@@ -37,6 +37,15 @@ cr.define('nux', function() { ...@@ -37,6 +37,15 @@ cr.define('nux', function() {
const INTERACTION_METRIC_COUNT = const INTERACTION_METRIC_COUNT =
Object.keys(NuxEmailProvidersInteractions).length; Object.keys(NuxEmailProvidersInteractions).length;
/**
* @typedef {{
* parentId: string,
* title: string,
* url: string,
* }}
*/
let bookmarkData;
/** @interface */ /** @interface */
class NuxEmailProxy { class NuxEmailProxy {
/** @param {string} id ID provided by callback when bookmark was added. */ /** @param {string} id ID provided by callback when bookmark was added. */
...@@ -74,8 +83,16 @@ cr.define('nux', function() { ...@@ -74,8 +83,16 @@ cr.define('nux', function() {
recordFinalize() {} recordFinalize() {}
} }
/** @implements {NuxEmailProxy} */ /** @implements {nux.NuxEmailProxy} */
class NuxEmailProxyImpl { class NuxEmailProxyImpl {
constructor() {
/** @private {string} */
this.firstPart = '';
/** @private {string} */
this.lastPart = '';
}
/** @override */ /** @override */
removeBookmark(id) { removeBookmark(id) {
chrome.bookmarks.remove(id); chrome.bookmarks.remove(id);
......
...@@ -86,7 +86,10 @@ Polymer({ ...@@ -86,7 +86,10 @@ Polymer({
this.hasAppsSelected = this.computeHasAppsSelected_(); this.hasAppsSelected = this.computeHasAppsSelected_();
}, },
/** @private {boolean} */ /**
* @return {boolean}
* @private
*/
computeHasAppsSelected_: function() { computeHasAppsSelected_: function() {
return this.appList.some(a => a.selected); return this.appList.some(a => a.selected);
}, },
......
...@@ -12,7 +12,7 @@ cr.define('nux', function() { ...@@ -12,7 +12,7 @@ cr.define('nux', function() {
addGoogleApps(selectedApps) {} addGoogleApps(selectedApps) {}
} }
/** @implements {NuxGoogleAppsProxy} */ /** @implements {nux.NuxGoogleAppsProxy} */
class NuxGoogleAppsProxyImpl { class NuxGoogleAppsProxyImpl {
/** @override */ /** @override */
addGoogleApps(selectedApps) { addGoogleApps(selectedApps) {
......
...@@ -54,7 +54,7 @@ cr.define('welcome', function() { ...@@ -54,7 +54,7 @@ cr.define('welcome', function() {
// Notifies all the elements that extended NavigationBehavior. // Notifies all the elements that extended NavigationBehavior.
function notifyObservers() { function notifyObservers() {
const route = history.state.route; const route = /** @type {!welcome.Routes} */ (history.state.route);
const step = history.state.step; const step = history.state.step;
routeObservers.forEach((observer) => { routeObservers.forEach((observer) => {
observer.onRouteChange(route, step); observer.onRouteChange(route, step);
...@@ -73,7 +73,9 @@ cr.define('welcome', function() { ...@@ -73,7 +73,9 @@ cr.define('welcome', function() {
// history state was set when page loaded, so when the element first // history state was set when page loaded, so when the element first
// attaches, call the route-change handler to initialize 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 */ /** @override */
...@@ -95,7 +97,7 @@ cr.define('welcome', function() { ...@@ -95,7 +97,7 @@ cr.define('welcome', function() {
}, },
/** /**
* @param {string} route * @param {!welcome.Routes} route
* @param {number} step * @param {number} step
*/ */
navigateTo: function(route, step) { navigateTo: function(route, step) {
......
...@@ -8,7 +8,7 @@ cr.define('nux', function() { ...@@ -8,7 +8,7 @@ cr.define('nux', function() {
setAsDefault() {} setAsDefault() {}
} }
/** @implements {NuxSetAsDefaultProxy} */ /** @implements {nux.NuxSetAsDefaultProxy} */
class NuxSetAsDefaultProxyImpl { class NuxSetAsDefaultProxyImpl {
/** @override */ /** @override */
setAsDefault() { setAsDefault() {
......
...@@ -27,7 +27,7 @@ Polymer({ ...@@ -27,7 +27,7 @@ Polymer({
}, },
/** /**
* @param {string} route * @param {welcome.Routes} route
* @param {number} step * @param {number} step
* @private * @private
*/ */
...@@ -46,6 +46,7 @@ Polymer({ ...@@ -46,6 +46,7 @@ Polymer({
this.$.viewManager.switchView('step-' + step); this.$.viewManager.switchView('step-' + step);
}, },
/** @param {!Array<string>} modules Array of valid DOM element names. */
initializeModules: function(modules) { initializeModules: function(modules) {
assert(this.currentRoute_); // this.currentRoute_ should be set by now. assert(this.currentRoute_); // this.currentRoute_ should be set by now.
if (this.currentRoute_ == welcome.Routes.LANDING) 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