Chromium Code Reviews| Index: chrome/browser/resources/options2/browser_options.js |
| =================================================================== |
| --- chrome/browser/resources/options2/browser_options.js (revision 119922) |
| +++ chrome/browser/resources/options2/browser_options.js (working copy) |
| @@ -213,6 +213,9 @@ |
| function(event) { |
| chrome.send('becomeDefaultBrowser'); |
| }); |
| + |
| + $('autoLaunch').addEventListener('click', |
|
James Hawkins
2012/02/06 21:08:01
nit: Use $('xx').onclick = this.handle...
|
| + this.handleAutoLaunchChanged_); |
| } |
| // Under the hood section. |
| @@ -323,6 +326,16 @@ |
| }, |
| /** |
| + * Shows the autoLaunch preference and initializes its checkbox value. |
| + * @param {bool} enabled Whether autolaunch is enabled or or not. |
| + * @private |
| + */ |
| + updateAutoLaunchState_: function(enabled) { |
| + $('autoLaunchOption').hidden = false; |
| + $('autoLaunch').checked = enabled; |
| + }, |
| + |
| + /** |
| * Called when the value of the instant.confirm_dialog_shown preference |
| * changes. Cache this value. |
| * @param {Event} event Change event. |
| @@ -445,6 +458,13 @@ |
| }, |
| /** |
| + * Sets or clear whether Chrome should Auto-launch on computer startup. |
|
James Hawkins
2012/02/06 21:08:01
@private
|
| + */ |
| + handleAutoLaunchChanged_: function() { |
| + chrome.send('toggleAutoLaunch', [Boolean($('autoLaunch').checked)]); |
|
James Hawkins
2012/02/06 21:08:01
Correct me if I'm wrong, but I don't think you nee
|
| + }, |
| + |
| + /** |
| * Sends an asynchronous request for new autocompletion suggestions for the |
| * the given query. When new suggestions are available, the C++ handler will |
| * call updateAutocompleteSuggestions_. |
| @@ -587,6 +607,7 @@ |
| 'setThemesResetButtonEnabled', |
| 'updateAccountPicture', |
| 'updateAutocompleteSuggestions', |
| + 'updateAutoLaunchState', |
| 'updateHomePageLabel', |
| 'updateSearchEngines', |
| 'updateStartupPages', |