Commit 5da28401 authored by Kristi Park's avatar Kristi Park Committed by Commit Bot

[NTP Cleanup] Remove @private annotations from local NTP

The @private annotations don't really serve a purpose.

Also, clean up some const ordering, missing JSDoc, and spelling errors.

Change-Id: Ib074aef2a51d226b84d1a00da6482eb607bb285f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1679438
Commit-Queue: Kristi Park <kristipark@chromium.org>
Reviewed-by: default avatarKyle Milka <kmilka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#672757}
parent f8107036
...@@ -168,10 +168,23 @@ customize.MENU_ENTRIES = { ...@@ -168,10 +168,23 @@ customize.MENU_ENTRIES = {
RESTORE_DEFAULT: 3, RESTORE_DEFAULT: 3,
}; };
/**
* The semi-transparent, gradient overlay for the custom background. Intended
* to improve readability of NTP elements/text.
* @type {string}
* @const
*/
customize.CUSTOM_BACKGROUND_OVERLAY = customize.CUSTOM_BACKGROUND_OVERLAY =
'linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.3))'; 'linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.3))';
// These shound match the corresponding values in local_ntp.js, that control the /**
* Number of rows in the custom background dialog to preload.
* @type {number}
* @const
*/
customize.ROWS_TO_PRELOAD = 3;
// These should match the corresponding values in local_ntp.js, that control the
// mv-notice element. // mv-notice element.
customize.delayedHideNotification = -1; customize.delayedHideNotification = -1;
customize.NOTIFICATION_TIMEOUT = 10000; customize.NOTIFICATION_TIMEOUT = 10000;
...@@ -188,24 +201,15 @@ customize.builtTiles = false; ...@@ -188,24 +201,15 @@ customize.builtTiles = false;
*/ */
customize.selectedBackgroundTile = null; customize.selectedBackgroundTile = null;
/**
* Number of rows in the custom background dialog to preload.
* @type {number}
* @const
*/
customize.ROWS_TO_PRELOAD = 3;
/** /**
* Called when the error notification should be shown. * Called when the error notification should be shown.
* @type {?Function} * @type {?Function}
* @private
*/ */
customize.showErrorNotification = null; customize.showErrorNotification = null;
/** /**
* Called when the custom link notification should be hidden. * Called when the custom link notification should be hidden.
* @type {?Function} * @type {?Function}
* @private
*/ */
customize.hideCustomLinkNotification = null; customize.hideCustomLinkNotification = null;
...@@ -213,14 +217,12 @@ customize.hideCustomLinkNotification = null; ...@@ -213,14 +217,12 @@ customize.hideCustomLinkNotification = null;
* The currently selected submenu (i.e. Background, Shortcuts, etc.) in the * The currently selected submenu (i.e. Background, Shortcuts, etc.) in the
* richer picker. Corresponds to the submenu's button element in the sidebar. * richer picker. Corresponds to the submenu's button element in the sidebar.
* @type {?Element} * @type {?Element}
* @private
*/ */
customize.richerPicker_selectedSubmenu = null; customize.richerPicker_selectedSubmenu = null;
/** /**
* The preselected options for Shortcuts in the richer picker. * The preselected options for Shortcuts in the richer picker.
* @type {Object} * @type {Object}
* @private
*/ */
customize.preselectedShortcutOptions = { customize.preselectedShortcutOptions = {
// Contains the selected type's DOM element, i.e. either custom links or most visited. // Contains the selected type's DOM element, i.e. either custom links or most visited.
...@@ -231,7 +233,6 @@ customize.preselectedShortcutOptions = { ...@@ -231,7 +233,6 @@ customize.preselectedShortcutOptions = {
/** /**
* The currently selected options for Shortcuts in the richer picker. * The currently selected options for Shortcuts in the richer picker.
* @type {Object} * @type {Object}
* @private
*/ */
customize.selectedShortcutOptions = { customize.selectedShortcutOptions = {
// Contains the preselected type's DOM element, i.e. either custom links or most visited. // Contains the preselected type's DOM element, i.e. either custom links or most visited.
...@@ -889,7 +890,7 @@ customize.removeSelectedState = function(tile) { ...@@ -889,7 +890,7 @@ customize.removeSelectedState = function(tile) {
}; };
/** /**
* Show dialog for selecting an image. Image data should previous have been * Show dialog for selecting an image. Image data should previously have been
* loaded into collImg via * loaded into collImg via
* chrome-search://local-ntp/ntp-background-images.js?collection_id=<collection_id> * chrome-search://local-ntp/ntp-background-images.js?collection_id=<collection_id>
* @param {string} dialogTitle The title to be displayed at the top of the * @param {string} dialogTitle The title to be displayed at the top of the
...@@ -1080,7 +1081,6 @@ customize.fadeInImageTile = function(tile, imageUrl, countLoad) { ...@@ -1080,7 +1081,6 @@ customize.fadeInImageTile = function(tile, imageUrl, countLoad) {
/** /**
* Load the NTPBackgroundCollections script. It'll create a global * Load the NTPBackgroundCollections script. It'll create a global
* variable name "coll" which is a dict of background collections data. * variable name "coll" which is a dict of background collections data.
* @private
*/ */
customize.loadChromeBackgrounds = function() { customize.loadChromeBackgrounds = function() {
const collElement = $('ntp-collection-loader'); const collElement = $('ntp-collection-loader');
......
...@@ -345,7 +345,6 @@ function getThemeBackgroundInfo() { ...@@ -345,7 +345,6 @@ function getThemeBackgroundInfo() {
* *
* @param {!Object} info Theme background information. * @param {!Object} info Theme background information.
* @return {boolean} Whether the chips should be dark. * @return {boolean} Whether the chips should be dark.
* @private
*/ */
function getUseDarkChips(info) { function getUseDarkChips(info) {
return info.usingDarkMode && !info.imageUrl; return info.usingDarkMode && !info.imageUrl;
...@@ -353,7 +352,6 @@ function getUseDarkChips(info) { ...@@ -353,7 +352,6 @@ function getUseDarkChips(info) {
/** /**
* Updates the NTP based on the current theme. * Updates the NTP based on the current theme.
* @private
*/ */
function renderTheme() { function renderTheme() {
const info = getThemeBackgroundInfo(); const info = getThemeBackgroundInfo();
...@@ -454,7 +452,6 @@ function renderTheme() { ...@@ -454,7 +452,6 @@ function renderTheme() {
/** /**
* Sends the current theme info to the most visited iframe. * Sends the current theme info to the most visited iframe.
* @private
*/ */
function sendThemeInfoToMostVisitedIframe() { function sendThemeInfoToMostVisitedIframe() {
const info = getThemeBackgroundInfo(); const info = getThemeBackgroundInfo();
...@@ -483,7 +480,6 @@ function sendThemeInfoToMostVisitedIframe() { ...@@ -483,7 +480,6 @@ function sendThemeInfoToMostVisitedIframe() {
/** /**
* Sends the current theme info to the edit custom link iframe. * Sends the current theme info to the edit custom link iframe.
* @private
*/ */
function sendThemeInfoToEditCustomLinkIframe() { function sendThemeInfoToEditCustomLinkIframe() {
if (!configData.isGooglePage) { if (!configData.isGooglePage) {
...@@ -504,7 +500,6 @@ function sendThemeInfoToEditCustomLinkIframe() { ...@@ -504,7 +500,6 @@ function sendThemeInfoToEditCustomLinkIframe() {
/** /**
* Updates the OneGoogleBar (if it is loaded) based on the current theme. * Updates the OneGoogleBar (if it is loaded) based on the current theme.
* TODO(crbug.com/918582): Add support for OGB dark mode. * TODO(crbug.com/918582): Add support for OGB dark mode.
* @private
*/ */
function renderOneGoogleBarTheme() { function renderOneGoogleBarTheme() {
if (!window.gbar) { if (!window.gbar) {
...@@ -524,7 +519,6 @@ function renderOneGoogleBarTheme() { ...@@ -524,7 +519,6 @@ function renderOneGoogleBarTheme() {
/** /**
* Callback for embeddedSearch.newTabPage.onthemechange. * Callback for embeddedSearch.newTabPage.onthemechange.
* @private
*/ */
function onThemeChange() { function onThemeChange() {
// Save the current dark mode state to check if dark mode has changed. // Save the current dark mode state to check if dark mode has changed.
...@@ -545,7 +539,6 @@ function onThemeChange() { ...@@ -545,7 +539,6 @@ function onThemeChange() {
/** /**
* Updates the NTP style according to theme. * Updates the NTP style according to theme.
* @param {Object} themeInfo The information about the theme. * @param {Object} themeInfo The information about the theme.
* @private
*/ */
function setCustomThemeStyle(themeInfo) { function setCustomThemeStyle(themeInfo) {
let textColor = ''; let textColor = '';
...@@ -571,7 +564,6 @@ function setCustomThemeStyle(themeInfo) { ...@@ -571,7 +564,6 @@ function setCustomThemeStyle(themeInfo) {
* @param {string} url The URL of the attribution image, if any. * @param {string} url The URL of the attribution image, if any.
* @param {string} themeBackgroundAlignment The alignment of the theme * @param {string} themeBackgroundAlignment The alignment of the theme
* background image. This is used to compute the attribution's alignment. * background image. This is used to compute the attribution's alignment.
* @private
*/ */
function updateThemeAttribution(url, themeBackgroundAlignment) { function updateThemeAttribution(url, themeBackgroundAlignment) {
if (!url) { if (!url) {
...@@ -597,7 +589,6 @@ function updateThemeAttribution(url, themeBackgroundAlignment) { ...@@ -597,7 +589,6 @@ function updateThemeAttribution(url, themeBackgroundAlignment) {
/** /**
* Sets the visibility of the theme attribution. * Sets the visibility of the theme attribution.
* @param {boolean} show True to show the attribution. * @param {boolean} show True to show the attribution.
* @private
*/ */
function setAttributionVisibility_(show) { function setAttributionVisibility_(show) {
$(IDS.ATTRIBUTION).style.display = show ? '' : 'none'; $(IDS.ATTRIBUTION).style.display = show ? '' : 'none';
...@@ -607,7 +598,6 @@ function setAttributionVisibility_(show) { ...@@ -607,7 +598,6 @@ function setAttributionVisibility_(show) {
* Converts an Array of color components into RGBA format "rgba(R,G,B,A)". * Converts an Array of color components into RGBA format "rgba(R,G,B,A)".
* @param {Array<number>} color Array of rgba color components. * @param {Array<number>} color Array of rgba color components.
* @return {string} CSS color in RGBA format. * @return {string} CSS color in RGBA format.
* @private
*/ */
function convertToRGBAColor(color) { function convertToRGBAColor(color) {
return 'rgba(' + color[0] + ',' + color[1] + ',' + color[2] + ',' + return 'rgba(' + color[0] + ',' + color[1] + ',' + color[2] + ',' +
......
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