diff options
author | bartfab@chromium.org <bartfab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-24 18:38:16 +0000 |
---|---|---|
committer | bartfab@chromium.org <bartfab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-24 18:38:16 +0000 |
commit | 373a6c9b7cd5ad059a70f3a76583193b8596d39f (patch) | |
tree | 63a83fa577580062e02ea43c675b3f0650a13592 /chrome/browser/resources/options/browser_options.js | |
parent | 518ee58ff2ed4f72e313fce4f3c29d2688b3ade1 (diff) | |
download | chromium_src-373a6c9b7cd5ad059a70f3a76583193b8596d39f.zip chromium_src-373a6c9b7cd5ad059a70f3a76583193b8596d39f.tar.gz chromium_src-373a6c9b7cd5ad059a70f3a76583193b8596d39f.tar.bz2 |
Clean up copy&paste in confirmation dialogs for prefs
This CL consolidates the three implementations of virtually identical
confirmation dialogs for prefs into a single class. The new code has
the further advantage that the confirmation dialogs no longer know about
and manipulate any input elements directly but instead, use the dialog
pref system to commit or roll back changes when they are confirmed or
cancelled.
BUG=157319
Review URL: https://chromiumcodereview.appspot.com/11232059
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163874 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources/options/browser_options.js')
-rw-r--r-- | chrome/browser/resources/options/browser_options.js | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js index 8314ee3..94b268c 100644 --- a/chrome/browser/resources/options/browser_options.js +++ b/chrome/browser/resources/options/browser_options.js @@ -25,20 +25,6 @@ cr.define('options', function() { syncSetupCompleted: false, /** - * The cached value of the instant.confirm_dialog_shown preference. - * @type {bool} - * @private - */ - instantConfirmDialogShown_: false, - - /** - * The cached value of the spellcheck.confirm_dialog_shown preference. - * @type {bool} - * @private - */ - spellcheckConfirmDialogShown_: false, - - /** * Keeps track of whether |onShowHomeButtonChanged_| has been called. See * |onShowHomeButtonChanged_|. * @type {bool} @@ -165,15 +151,6 @@ cr.define('options', function() { }; $('default-search-engine').addEventListener('change', this.setDefaultSearchEngine_); - $('instant-enabled-control').customChangeHandler = function(event) { - if (this.checked && !self.instantConfirmDialogShown_) { - OptionsPage.showPageByName('instantConfirm', false); - return true; // Stop default preference processing. - } - return false; // Allow default preference processing. - }; - Preferences.getInstance().addEventListener('instant.confirm_dialog_shown', - this.onInstantConfirmDialogShownChanged_.bind(this)); // Users section. if (loadTimeData.valueExists('profilesInfo')) { @@ -251,20 +228,6 @@ cr.define('options', function() { OptionsPage.navigateToPage('clearBrowserData'); chrome.send('coreOptionsUserMetricsAction', ['Options_ClearData']); }; - // 'spelling-enabled-control' element is only present on Chrome branded - // builds. - if ($('spelling-enabled-control')) { - $('spelling-enabled-control').customChangeHandler = function(event) { - if (this.checked && !self.spellcheckConfirmDialogShown_) { - OptionsPage.showPageByName('spellingConfirm', false); - return true; - } - return false; - }; - Preferences.getInstance().addEventListener( - 'spellcheck.confirm_dialog_shown', - this.onSpellcheckConfirmDialogShownChanged_.bind(this)); - } // 'metricsReportingEnabled' element is only present on Chrome branded // builds. if ($('metricsReportingEnabled')) { @@ -273,13 +236,6 @@ cr.define('options', function() { [String(event.target.checked)]); }; } - $('do-not-track-enabled').customChangeHandler = function(event) { - if (this.checked) { - OptionsPage.showPageByName('doNotTrackConfirm', false); - return true; - } - return false; - }; // Bluetooth (CrOS only). if (cr.isChromeOS) { @@ -737,26 +693,6 @@ cr.define('options', function() { }, /** - * Called when the value of the instant.confirm_dialog_shown preference - * changes. Cache this value. - * @param {Event} event Change event. - * @private - */ - onInstantConfirmDialogShownChanged_: function(event) { - this.instantConfirmDialogShown_ = event.value.value; - }, - - /** - * Called when the value of the spellcheck.confirm_dialog_shown preference - * changes. Cache this value. - * @param {Event} event Change event. - * @private - */ - onSpellcheckConfirmDialogShownChanged_: function(event) { - this.spellcheckConfirmDialogShown_ = event.value.value; - }, - - /** * Called when the value of the download.default_directory preference * changes. * @param {Event} event Change event. |