| 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..e8b46fb4168c9f0734fd2230780f089c326c5692 100644
|
| --- a/chrome/browser/resources/options/browser_options.js
|
| +++ b/chrome/browser/resources/options/browser_options.js
|
| @@ -83,9 +83,18 @@ cr.define('options', function() {
|
| return true;
|
| };
|
|
|
| + $('instantFieldTrialCheckbox').addEventListener('change',
|
| + function(event) {
|
| + 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 +178,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 +518,10 @@ cr.define('options', function() {
|
| BrowserOptions.getInstance().updateAutocompleteSuggestions_(suggestions);
|
| };
|
|
|
| + BrowserOptions.setInstantFieldTrialStatus = function(enabled) {
|
| + BrowserOptions.getInstance().setInstantFieldTrialStatus_(enabled);
|
| + };
|
| +
|
| // Export
|
| return {
|
| BrowserOptions: BrowserOptions
|
|
|