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

Unified Diff: chrome/browser/resources/options/browser_options.js

Issue 11232046: Add fifth batch of controlled setting indicators (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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/browser_options.js
diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js
index 8314ee3371f8c3b2856e959f5d43f8d505fcecb7..83c64547cfcb6e4ac14c61ff32c572c09cc9f9a9 100644
--- a/chrome/browser/resources/options/browser_options.js
+++ b/chrome/browser/resources/options/browser_options.js
@@ -168,10 +168,27 @@ cr.define('options', function() {
$('instant-enabled-control').customChangeHandler = function(event) {
if (this.checked && !self.instantConfirmDialogShown_) {
OptionsPage.showPageByName('instantConfirm', false);
+ InstantConfirmOverlay.getInstance().confirming_follow_recommendation =
+ false;
return true; // Stop default preference processing.
}
return false; // Allow default preference processing.
};
+ var instant_enabled_indicator = $('instant-enabled-indicator');
+ Preferences.getInstance().addEventListener(
+ instant_enabled_indicator.pref, function(event) {
+ instant_enabled_indicator.recommendedValue =
+ event.value.recommendedValue;
+ });
Joao da Silva 2012/10/22 20:47:38 Shouldn't this be handled by the generic code that
bartfab (slow) 2012/10/23 10:28:31 Thanks for the comments. They motivated me to bite
+ instant_enabled_indicator.resetHandler = function() {
+ if (this.recommendedValue && !self.instantConfirmDialogShown_) {
+ OptionsPage.showPageByName('instantConfirm', false);
+ InstantConfirmOverlay.getInstance().confirming_follow_recommendation =
+ true;
+ } else {
+ Preferences.clearPref(this.pref, true);
+ }
+ };
Preferences.getInstance().addEventListener('instant.confirm_dialog_shown',
this.onInstantConfirmDialogShownChanged_.bind(this));
@@ -257,10 +274,27 @@ cr.define('options', function() {
$('spelling-enabled-control').customChangeHandler = function(event) {
if (this.checked && !self.spellcheckConfirmDialogShown_) {
OptionsPage.showPageByName('spellingConfirm', false);
+ SpellingConfirmOverlay.getInstance()
+ .confirming_follow_recommendation = false;
return true;
}
return false;
};
+ var spelling_enabled_indicator = $('spelling-enabled-indicator');
+ Preferences.getInstance().addEventListener(
+ spelling_enabled_indicator.pref, function(event) {
+ spelling_enabled_indicator.recommendedValue =
+ event.value.recommendedValue;
Joao da Silva 2012/10/22 20:47:38 Same here. This code can be shared for prefs that
+ });
+ spelling_enabled_indicator.resetHandler = function() {
+ if (this.recommendedValue && !self.spellcheckConfirmDialogShown_) {
+ OptionsPage.showPageByName('spellingConfirm', false);
+ SpellingConfirmOverlay.getInstance()
+ .confirming_follow_recommendation = true;
+ } else {
+ Preferences.clearPref(this.pref, true);
+ }
+ };
Preferences.getInstance().addEventListener(
'spellcheck.confirm_dialog_shown',
this.onSpellcheckConfirmDialogShownChanged_.bind(this));
« no previous file with comments | « chrome/browser/resources/options/browser_options.html ('k') | chrome/browser/resources/options/import_data_overlay.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698