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

Unified Diff: chrome/browser/resources/options/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: Fixed PrefCheckbox. Created 8 years, 3 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/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
« no previous file with comments | « chrome/browser/resources/options/chromeos/proxy_rules_list.js ('k') | chrome/browser/resources/options/font_settings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698