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

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: Addressed Miranda's comments, for realz this time 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
« no previous file with comments | « chrome/browser/resources/options2/browser_options.html ('k') | chrome/browser/ui/browser_init.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options2/browser_options.js
===================================================================
--- chrome/browser/resources/options2/browser_options.js (revision 120769)
+++ chrome/browser/resources/options2/browser_options.js (working copy)
@@ -215,6 +215,8 @@
$('set-as-default-browser').onclick = function(event) {
chrome.send('becomeDefaultBrowser');
};
+
+ $('auto-launch').onclick = this.handleAutoLaunchChanged_;
}
// Under the hood section.
@@ -331,6 +333,16 @@
},
/**
+ * Shows the autoLaunch preference and initializes its checkbox value.
+ * @param {bool} enabled Whether autolaunch is enabled or or not.
+ * @private
+ */
+ updateAutoLaunchState_: function(enabled) {
+ $('auto-launch-option').hidden = false;
+ $('auto-launch').checked = enabled;
+ },
+
+ /**
* Called when the value of the instant.confirm_dialog_shown preference
* changes. Cache this value.
* @param {Event} event Change event.
@@ -475,6 +487,14 @@
},
/**
+ * Sets or clear whether Chrome should Auto-launch on computer startup.
+ * @private
+ */
+ handleAutoLaunchChanged_: function() {
+ chrome.send('toggleAutoLaunch', [$('auto-launch').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_.
@@ -617,6 +637,7 @@
'setThemesResetButtonEnabled',
'updateAccountPicture',
'updateAutocompleteSuggestions',
+ 'updateAutoLaunchState',
'updateHomePageLabel',
'updateSearchEngines',
'updateStartupPages',
« no previous file with comments | « chrome/browser/resources/options2/browser_options.html ('k') | chrome/browser/ui/browser_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698