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

Unified Diff: chrome/browser/resources/options2/controlled_setting.js

Issue 10827141: Move handling of dialog preferences to Preferences class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix my rushed copy & paste :( Created 8 years, 5 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/options2/controlled_setting.js
diff --git a/chrome/browser/resources/options2/controlled_setting.js b/chrome/browser/resources/options2/controlled_setting.js
index 9ff806c178b7686262c33849e8303917040efcaf..3d4747012688ea9f3edf5cbe0fc54340b0014d5e 100644
--- a/chrome/browser/resources/options2/controlled_setting.js
+++ b/chrome/browser/resources/options2/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,15 @@ cr.define('options', function() {
cr.PropertyKind.ATTR,
ControlledSettingIndicator.prototype.close);
+ /**
+ * A special preference type specific to dialogs. These preferences are reset
+ * when the dialog is closed and are not saved until the user confirms the
+ * dialog.
+ * @type {boolean}
+ */
+ cr.defineProperty(ControlledSettingIndicator, 'dialogPref',
+ cr.PropertyKind.BOOL_ATTR);
+
// Export.
return {
ControlledSettingIndicator: ControlledSettingIndicator

Powered by Google App Engine
This is Rietveld 408576698