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

Unified Diff: chrome/browser/resources/settings/controls/settings_dropdown_menu.js

Issue 1420533011: [MD settings] change dropdown to accept array of objects rather than array of tuples (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@appearance50p
Patch Set: trybot fix Created 5 years, 1 month 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/settings/controls/settings_dropdown_menu.js
diff --git a/chrome/browser/resources/settings/controls/settings_dropdown_menu.js b/chrome/browser/resources/settings/controls/settings_dropdown_menu.js
index 95f86ac4f1ff5c9295f04700a422d46f035ed834..9bfa1d75a9112bf7883e4732f68ec930a6de0bf1 100644
--- a/chrome/browser/resources/settings/controls/settings_dropdown_menu.js
+++ b/chrome/browser/resources/settings/controls/settings_dropdown_menu.js
@@ -2,14 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
- /**
- * This tuple is made up of a (value, name, attribute). The value and name are
- * used by the dropdown menu. The attribute is optional 'user data' that is
- * ignored by the dropdown menu.
+/**
+ * The |name| is shown in the gui. The |value| us use to set or compare with
+ * the preference value.
* @typedef {{
- * 0: (number|string),
- * 1: string,
- * 2: (string|undefined)
+ * name: string,
+ * value: (number|string)
* }}
*/
var DropdownMenuOption;
@@ -40,7 +38,6 @@ Polymer({
/**
* List of options for the drop-down menu.
- * TODO(michaelpg): use named properties instead of indices.
* @type {DropdownMenuOptionList}
*/
menuOptions: {
@@ -139,7 +136,7 @@ Polymer({
return;
var prefValue = this.pref.value;
var option = this.menuOptions.find(function(menuItem) {
- return menuItem[0] == prefValue;
+ return menuItem.value == prefValue;
});
if (option == undefined)
this.selected_ = this.notFoundValue_;

Powered by Google App Engine
This is Rietveld 408576698