Index: chrome/browser/resources/options/browser_options.js |
=================================================================== |
--- chrome/browser/resources/options/browser_options.js (revision 114230) |
+++ chrome/browser/resources/options/browser_options.js (working copy) |
@@ -113,6 +113,9 @@ |
$('defaultBrowserUseAsDefaultButton').onclick = function(event) { |
chrome.send('becomeDefaultBrowser'); |
}; |
+ |
+ $('autoLaunch').addEventListener('click', |
+ this.handleAutoLaunchChanged_); |
} |
var startupPagesList = $('startupPagesList'); |
@@ -282,7 +285,7 @@ |
}, |
/** |
- * Handle change events of the preference |
+ * Handles change events of the preference |
* 'session.urls_to_restore_on_startup'. |
* @param {event} preference changed event. |
* @private |
@@ -293,7 +296,7 @@ |
}, |
/** |
- * Set the default search engine based on the popup selection. |
+ * Sets the default search engine based on the popup selection. |
*/ |
setDefaultSearchEngine_: function() { |
var engineSelect = $('defaultSearchEngine'); |
@@ -305,6 +308,13 @@ |
}, |
/** |
+ * Sets or clear whether Chrome should Auto-launch on computer startup. |
+ */ |
+ handleAutoLaunchChanged_: function() { |
+ chrome.send('toggleAutoLaunch', [Boolean($('autoLaunch').checked)]); |
+ }, |
+ |
+ /** |
* Sends an asynchronous request for new autocompletion suggestions for the |
* the given query. When new suggestions are available, the C++ handler will |
* call updateAutocompleteSuggestions_. |
@@ -329,6 +339,14 @@ |
return; |
list.suggestions = suggestions; |
}, |
+ |
+ /** |
+ * Shows the autoLaunch preference and initializes its checkbox value. |
+ */ |
+ updateAutoLaunchState_: function(enabled) { |
+ $('autoLaunchOption').hidden = false; |
+ $('autoLaunch').checked = enabled; |
+ }, |
}; |
BrowserOptions.updateDefaultBrowserState = function(statusString, isDefault, |
@@ -354,6 +372,10 @@ |
BrowserOptions.getInstance().updateAutocompleteSuggestions_(suggestions); |
}; |
+ BrowserOptions.updateAutoLaunchState = function(enabled) { |
+ BrowserOptions.getInstance().updateAutoLaunchState_(enabled); |
+ }; |
+ |
BrowserOptions.setInstantFieldTrialStatus = function(enabled) { |
BrowserOptions.getInstance().setInstantFieldTrialStatus_(enabled); |
}; |