Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1575)

Unified Diff: chrome/browser/resources/options2/browser_options.js

Issue 9317002: Make the auto-launch experiment profile-aware. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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',

Powered by Google App Engine
This is Rietveld 408576698