Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3788)

Unified Diff: chrome/browser/resources/options/chromeos/onc_data.js

Issue 570503002: Compile chrome://settings, part 6 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@H_options_errors_4
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/options/chromeos/onc_data.js
diff --git a/chrome/browser/resources/options/chromeos/onc_data.js b/chrome/browser/resources/options/chromeos/onc_data.js
index f32491eeb136e463e3849ca8629bda797df4c913..d3d66252614300f8555ebc8d002f83a67175066b 100644
--- a/chrome/browser/resources/options/chromeos/onc_data.js
+++ b/chrome/browser/resources/options/chromeos/onc_data.js
@@ -22,8 +22,8 @@ cr.define('cr.onc', function() {
/**
* Returns either a managed property dictionary or an unmanaged value.
* @param {string} key The property key.
- * @return {*} The property value or dictionary if it exists, otherwise
- * undefined.
+ * @return {(Object|string|undefined)} The property value or dictionary if
+ * it exists, otherwise undefined.
*/
getManagedProperty: function(key) {
var data = this.data_;
@@ -44,7 +44,7 @@ cr.define('cr.onc', function() {
* Sets the value of a property. Currently only supports unmanaged
* properties.
* @param {string} key The property key.
- * @param {string} value The property value to set.
+ * @param {Object} value The property value to set.
*/
setManagedProperty: function(key, value) {
var data = this.data_;
@@ -76,7 +76,8 @@ cr.define('cr.onc', function() {
/**
* Gets the active value of a property.
* @param {string} key The property key.
- * @return {*} The property value or undefined.
+ * @return {(Object|Array|string|undefined)} The property value or
Dan Beam 2014/09/12 03:25:20 @typedef
Vitaly Pavlenko 2014/09/12 19:16:23 Done.
+ * undefined.
*/
getActiveValue: function(key) {
var property = this.getManagedProperty(key);
@@ -86,7 +87,8 @@ cr.define('cr.onc', function() {
if ('Active' in property)
return property['Active'];
// If no Active value is defined, return the effective value if present.
- var effective = this.getEffectiveValueFromProperty_(property);
+ var effective = this.getEffectiveValueFromProperty_(
+ /** @type {Object} */(property));
if (effective != undefined)
return effective;
// Otherwise this is an Object but not a Managed one.
@@ -97,7 +99,8 @@ cr.define('cr.onc', function() {
* Gets the translated ONC value from the result of getActiveValue() using
* loadTimeData. If no translation exists, returns the untranslated value.
* @param {string} key The property key.
- * @return {*} The translation if available or the value if not.
+ * @return {(Object|Array|string|undefined)} The translation if available or
+ * the value if not.
*/
getTranslatedValue: function(key) {
var value = this.getActiveValue(key);
@@ -121,7 +124,8 @@ cr.define('cr.onc', function() {
/**
* Gets the recommended value of a property.
* @param {string} key The property key.
- * @return {*} The property value or undefined.
+ * @return {(Object|Array|string|undefined)} The property value or
+ * undefined.
*/
getRecommendedValue: function(key) {
var property = this.getManagedProperty(key);
@@ -176,7 +180,8 @@ cr.define('cr.onc', function() {
/**
* Get the effective value from a Managed property ONC dictionary.
* @param {Object} property The managed property ONC dictionary.
- * @return {*} The effective value or undefined.
+ * @return {(Object|Array|string|undefined)} The effective value or
+ * undefined.
* @private
*/
getEffectiveValueFromProperty_: function(property) {

Powered by Google App Engine
This is Rietveld 408576698