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

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

Issue 8729009: Implement an AutoLaunch experiment for Chrome for certain brand codes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years 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/options/browser_options.html ('k') | chrome/browser/ui/browser_init.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « chrome/browser/resources/options/browser_options.html ('k') | chrome/browser/ui/browser_init.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698