| Index: chrome/browser/resources/options/confirm_dialog.js
|
| diff --git a/chrome/browser/resources/options/confirm_dialog.js b/chrome/browser/resources/options/confirm_dialog.js
|
| index cbce2751163a599b408ad75f71b1f3ad68f71ba1..abf69e9219ef1f18f7a2c397c0e7d71a74cd9231 100644
|
| --- a/chrome/browser/resources/options/confirm_dialog.js
|
| +++ b/chrome/browser/resources/options/confirm_dialog.js
|
| @@ -18,18 +18,26 @@ cr.define('options', function() {
|
| * @param {HTMLInputElement} cancelButton The cancellation button element.
|
| * @param {string} pref The pref that requires confirmation.
|
| * @param {string} metric User metrics identifier.
|
| - * @param {string} confirmed_pref A pref used to remember whether the user has
|
| - * confirmed the dialog before. This ensures that the user is presented
|
| - * with the dialog only once. If left |undefined| or |null|, the dialog
|
| + * @param {string=} opt_confirmedPref A pref used to remember whether the
|
| + * user has confirmed the dialog before. This ensures that the user is
|
| + * presented with the dialog only once. If left |undefined|, the dialog
|
| * will pop up every time the user attempts to set |pref| to |true|.
|
| * @extends {options.SettingsDialog}
|
| */
|
| function ConfirmDialog(name, title, pageDivName, okButton, cancelButton, pref,
|
| - metric, confirmed_pref) {
|
| + metric, opt_confirmedPref) {
|
| SettingsDialog.call(this, name, title, pageDivName, okButton, cancelButton);
|
| +
|
| + /** @protected */
|
| this.pref = pref;
|
| +
|
| + /** @protected */
|
| this.metric = metric;
|
| - this.confirmed_pref = confirmed_pref;
|
| +
|
| + /** @private */
|
| + this.confirmedPref_ = opt_confirmedPref;
|
| +
|
| + /** @private */
|
| this.confirmed_ = false;
|
| }
|
|
|
| @@ -56,7 +64,7 @@ cr.define('options', function() {
|
| },
|
|
|
| /**
|
| - * Handle changes to |confirmed_pref| by caching them.
|
| + * Handle changes to |confirmedPref_| by caching them.
|
| * @param {Event} event Change event.
|
| * @private
|
| */
|
| @@ -72,15 +80,15 @@ cr.define('options', function() {
|
| this.cancelButton.onclick = this.handleCancel.bind(this);
|
| Preferences.getInstance().addEventListener(
|
| this.pref, this.onPrefChanged_.bind(this));
|
| - if (this.confirmed_pref) {
|
| + if (this.confirmedPref_) {
|
| Preferences.getInstance().addEventListener(
|
| - this.confirmed_pref, this.onConfirmedChanged_.bind(this));
|
| + this.confirmedPref_, this.onConfirmedChanged_.bind(this));
|
| }
|
| },
|
|
|
| /**
|
| * Handle the confirm button by committing the |pref| change. If
|
| - * |confirmed_pref| has been specified, also remember that the dialog has
|
| + * |confirmedPref_| has been specified, also remember that the dialog has
|
| * been confirmed to avoid bringing it up in the future.
|
| * @override
|
| */
|
| @@ -88,8 +96,8 @@ cr.define('options', function() {
|
| SettingsDialog.prototype.handleConfirm.call(this);
|
|
|
| Preferences.getInstance().commitPref(this.pref, this.metric);
|
| - if (this.confirmed_pref)
|
| - Preferences.setBooleanPref(this.confirmed_pref, true, true);
|
| + if (this.confirmedPref_)
|
| + Preferences.setBooleanPref(this.confirmedPref_, true, true);
|
| },
|
|
|
| /**
|
|
|