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

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

Issue 11475028: Add new instant extended specific pref. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 7ac6f17a521471c5f2ae3434dac3c0ee82a70698..26e44090b33eac97f483bd5306072b384854ac5a 100644
--- a/chrome/browser/resources/options/browser_options.js
+++ b/chrome/browser/resources/options/browser_options.js
@@ -158,6 +158,19 @@ cr.define('options', function() {
};
$('default-search-engine').addEventListener('change',
this.setDefaultSearchEngine_);
+ if (loadTimeData.getValue('instant_extended')) {
+ // The control must be duplicated because we can't change the pref
+ // attribute here, it would be too late, since the value is initialized
+ // earlier using the original pref name, so we swap the controls.
+ $('instant-enabled-control').hidden = true;
+ $('instant-extended-enabled-control').hidden = false;
+ // For the other elements, we can simply modify them here as follows.
+ $('instant-enabled-indicator').removeAttribute('dialog-pref');
+ $('instant-enabled-control').setAttribute('pref',
+ 'instant_extended.enabled');
+ $('instant-enabled-control-label').setAttribute(
+ 'for', 'instant-extended-enabled-control');
+ }
// Users section.
if (loadTimeData.valueExists('profilesInfo')) {

Powered by Google App Engine
This is Rietveld 408576698