Index: chrome/browser/resources/options/controlled_setting.js |
diff --git a/chrome/browser/resources/options/controlled_setting.js b/chrome/browser/resources/options/controlled_setting.js |
index 9ff806c178b7686262c33849e8303917040efcaf..03c92cc1ef584e1641a31d77d955f6b0ed1fe92d 100644 |
--- a/chrome/browser/resources/options/controlled_setting.js |
+++ b/chrome/browser/resources/options/controlled_setting.js |
@@ -109,7 +109,7 @@ cr.define('options', function() { |
action.addEventListener( |
'click', |
function(e) { |
- Preferences.clearPref(pref); |
+ Preferences.clearPref(pref, self.dialogPref); |
}); |
container.appendChild(action); |
bubbleText.appendChild(container); |
@@ -131,6 +131,16 @@ cr.define('options', function() { |
cr.PropertyKind.ATTR, |
ControlledSettingIndicator.prototype.close); |
+ /** |
+ * A special preference type specific to dialogs. 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. |
+ * @type {boolean} |
+ */ |
+ cr.defineProperty(ControlledSettingIndicator, 'dialogPref', |
+ cr.PropertyKind.BOOL_ATTR); |
+ |
// Export. |
return { |
ControlledSettingIndicator: ControlledSettingIndicator |