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

Unified Diff: chrome/browser/resources/options/pref_ui.js

Issue 1061263004: Fixes wrong inheritance of PrefSelect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review comments. Created 5 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/pref_ui.js
diff --git a/chrome/browser/resources/options/pref_ui.js b/chrome/browser/resources/options/pref_ui.js
index a4a1127c75defebe4b85a0c60d37b4d15cf065aa..c0776fee447b9fc043dab46e16d958609c550cf1 100644
--- a/chrome/browser/resources/options/pref_ui.js
+++ b/chrome/browser/resources/options/pref_ui.js
@@ -390,7 +390,13 @@ cr.define('options', function() {
PrefSelect.prototype = {
// Set up the prototype chain
- __proto__: PrefInputElement.prototype,
+ __proto__: HTMLSelectElement.prototype,
+
+ /** @override */
+ decorate: PrefInputElement.prototype.decorate,
+
+ /** @override */
+ handleChange: PrefInputElement.prototype.handleChange,
/**
* Update the associated pref when when the user selects an item.
@@ -449,8 +455,47 @@ cr.define('options', function() {
if (this.onchange)
this.onchange(event);
},
+
+ /** @override */
+ setDisabled: PrefInputElement.prototype.setDisabled,
+
+ /** @override */
+ customChangeHandler: PrefInputElement.prototype.customChangeHandler,
+
+ /** @override */
+ customPrefChangeHandler: PrefInputElement.prototype.customPrefChangeHandler,
};
+ /**
+ * The name of the associated preference.
+ */
+ cr.defineProperty(PrefSelect, 'pref', cr.PropertyKind.ATTR);
+
+ /**
+ * The data type of the associated preference, only relevant for derived
+ * classes that support different data types.
+ */
+ cr.defineProperty(PrefSelect, 'dataType', cr.PropertyKind.ATTR);
+
+ /**
+ * Whether this input element is part of a dialog. If so, changes take effect
+ * in the settings UI immediately but are only actually committed when the
+ * user confirms the dialog. If the user cancels the dialog instead, the
+ * changes are rolled back in the settings UI and never committed.
+ */
+ cr.defineProperty(PrefSelect, 'dialogPref', cr.PropertyKind.BOOL_ATTR);
+
+ /**
+ * Whether the associated preference is controlled by a source other than the
+ * user's setting (can be 'policy', 'extension', 'recommended' or unset).
+ */
+ cr.defineProperty(PrefSelect, 'controlledBy', cr.PropertyKind.ATTR);
+
+ /**
+ * The user metric string.
+ */
+ cr.defineProperty(PrefSelect, 'metric', cr.PropertyKind.ATTR);
+
/////////////////////////////////////////////////////////////////////////////
// PrefTextField class:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698