diff options
Diffstat (limited to 'chrome/browser/resources/options/about_page.js')
| -rw-r--r-- | chrome/browser/resources/options/about_page.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/chrome/browser/resources/options/about_page.js b/chrome/browser/resources/options/about_page.js index a6490a3..8276057 100644 --- a/chrome/browser/resources/options/about_page.js +++ b/chrome/browser/resources/options/about_page.js @@ -32,6 +32,15 @@ cr.define('options', function() { $('aboutPageMoreInfo').classList.remove('hidden'); }; + if (cr.commandLine.options['--bwsi']) { + $('channelSelect').disabled = true; + } else { + $('channelSelect').onchange = function(event) { + var channel = event.target.value; + chrome.send('SetReleaseTrack', [channel]); + }; + } + // Notify the handler that the page is ready. chrome.send('PageReady'); }, @@ -49,6 +58,26 @@ cr.define('options', function() { updateEnable_: function(enable) { $('checkNow').disabled = !enable; }, + + // Updates the selected option in 'channelSelect' <select> element. + updateSelectedOption_: function(value) { + var options = $('channelSelect').querySelectorAll('option'); + for (var i = 0; i < options.length; i++) { + var option = options[i]; + if (option.value == value) { + option.selected = true; + } + } + }, + + // Changes the "check now" button to "restart now" button. + changeToRestartButton_: function() { + $('checkNow').textContent = localStrings.getString('restart_now'); + $('checkNow').disabled = false; + $('checkNow').onclick = function(event) { + chrome.send('RestartNow'); + }; + }, }; AboutPage.updateOSVersionCallback = function(versionString) { @@ -63,10 +92,18 @@ cr.define('options', function() { AboutPage.getInstance().updateEnable_(enable); }; + AboutPage.updateSelectedOptionCallback = function(value) { + AboutPage.getInstance().updateSelectedOption_(value); + }; + AboutPage.setUpdateImage = function(state) { $('updateIcon').className= 'update-icon ' + state; }; + AboutPage.changeToRestartButton = function() { + AboutPage.getInstance().changeToRestartButton_(); + }; + // Export return { AboutPage: AboutPage |
