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

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, 1 month 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/options/browser_options.js
===================================================================
--- chrome/browser/resources/options/browser_options.js (revision 111708)
+++ 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');
@@ -304,6 +307,13 @@
},
/**
+ * Set or clear whether Chrome should Auto-launch on computer startup.
stuartmorgan 2011/12/01 10:11:44 s/Set/Sets/ (the previous two functions are incorr
+ */
+ 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_.
@@ -328,6 +338,15 @@
return;
list.suggestions = suggestions;
},
+
+ /**
+ * A handler for the C++ code to call us and and let us know whether the
+ * auto-launch option should be visible and what its value should be.
stuartmorgan 2011/12/01 10:11:44 This comment doesn't match the implementation. If
+ */
+ updateAutoLaunchState_: function(enabled) {
+ $('autoLaunchOption').hidden = false;
+ $('autoLaunch').checked = enabled;
+ },
};
BrowserOptions.updateDefaultBrowserState = function(statusString, isDefault,
@@ -353,6 +372,10 @@
BrowserOptions.getInstance().updateAutocompleteSuggestions_(suggestions);
};
+ BrowserOptions.updateAutoLaunchState = function(enabled) {
+ BrowserOptions.getInstance().updateAutoLaunchState_(enabled);
+ };
+
BrowserOptions.setInstantFieldTrialStatus = function(enabled) {
BrowserOptions.getInstance().setInstantFieldTrialStatus_(enabled);
};

Powered by Google App Engine
This is Rietveld 408576698