Chromium Code Reviews| 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 ffd838e4a2c7fa0d24f777617a75f8a37c5b43be..d4e8042d2347ac4670df328eae22c5cb061005c2 100644 |
| --- a/chrome/browser/resources/options/browser_options.js |
| +++ b/chrome/browser/resources/options/browser_options.js |
| @@ -83,9 +83,17 @@ cr.define('options', function() { |
| return true; |
| }; |
| + $('instantFieldTrialCheckbox').onchange = function(event) { |
|
Sheridan Rawlins
2011/07/26 07:07:15
Follow style of others in this file: use addEventL
sreeram
2011/07/26 07:36:10
Done.
|
| + this.checked = true; |
| + chrome.send('disableInstant'); |
| + } |
| + |
| Preferences.getInstance().addEventListener('instant.confirm_dialog_shown', |
| this.onInstantConfirmDialogShownChanged_.bind(this)); |
| + Preferences.getInstance().addEventListener('instant.enabled', |
| + this.onInstantEnabledChanged_.bind(this)); |
| + |
| var homepageField = $('homepageURL'); |
| $('homepageUseNTPButton').onchange = |
| this.handleHomepageUseNTPButtonChange_.bind(this); |
| @@ -169,6 +177,26 @@ cr.define('options', function() { |
| }, |
| /** |
| + * Called when the value of the instant.enabled preference changes. Request |
| + * the state of the Instant field trial experiment. |
| + * @param {Event} event Change event. |
| + * @private |
| + */ |
| + onInstantEnabledChanged_: function(event) { |
| + chrome.send('getInstantFieldTrialStatus'); |
| + }, |
| + |
| + /** |
| + * Called to set the Instant field trial status. |
| + * @param {boolean} enabled If true, the experiment is enabled. |
| + * @private |
| + */ |
| + setInstantFieldTrialStatus_: function(enabled) { |
| + $('instantEnabledCheckbox').hidden = enabled; |
| + $('instantFieldTrialCheckbox').hidden = !enabled; |
| + }, |
| + |
| + /** |
| * Update the Default Browsers section based on the current state. |
| * @param {string} statusString Description of the current default state. |
| * @param {boolean} isDefault Whether or not the browser is currently |
| @@ -489,6 +517,10 @@ cr.define('options', function() { |
| BrowserOptions.getInstance().updateAutocompleteSuggestions_(suggestions); |
| }; |
| + BrowserOptions.setInstantFieldTrialStatus = function(enabled) { |
| + BrowserOptions.getInstance().setInstantFieldTrialStatus_(enabled); |
| + }; |
| + |
| // Export |
| return { |
| BrowserOptions: BrowserOptions |