summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/options
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-15 10:45:32 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-15 10:45:32 +0000
commit0cba296108328045bad62e2286f5ec6a2e4fd7e8 (patch)
tree5d60490adfbb0d68f62e51809551b6cfb6e19063 /chrome/browser/resources/options
parente69786054d76d7a8cc2a15536597b2ffb248afde (diff)
downloadchromium_src-0cba296108328045bad62e2286f5ec6a2e4fd7e8.zip
chromium_src-0cba296108328045bad62e2286f5ec6a2e4fd7e8.tar.gz
chromium_src-0cba296108328045bad62e2286f5ec6a2e4fd7e8.tar.bz2
Implement an AutoLaunch experiment for Chrome for certain brand codes. This is for Windows only.
BUG=95971 TEST=This requires a special branded build to test (and master_preferences set to have auto_launch_chrome: true or specify mini_installer param --auto-launch-chrome), but after installing it you should see an item under the Wrench \ Options \ Basics that lets you configure Chrome to not auto-launch. If you instead, log out and log in again, Chrome should start with an infobar saying that it was auto-launched. The infobar should stay for a max of 5 launches and then not appear again. Pressing "Cut it out!" on the infobar should turn off this feature. If you just want to test the infobar, launch chrome with --auto-launch-at-startup. Also, uninstall and make sure Chrome is not auto-launched (a Windows error about Chrome not being found should not be shown). Review URL: http://codereview.chromium.org/8729009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114621 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources/options')
-rw-r--r--chrome/browser/resources/options/browser_options.html7
-rw-r--r--chrome/browser/resources/options/browser_options.js26
2 files changed, 31 insertions, 2 deletions
diff --git a/chrome/browser/resources/options/browser_options.html b/chrome/browser/resources/options/browser_options.html
index 2af7b17..4d06327 100644
--- a/chrome/browser/resources/options/browser_options.html
+++ b/chrome/browser/resources/options/browser_options.html
@@ -121,6 +121,13 @@
i18n-content="defaultBrowserUseAsDefault"></button>
<div id="defaultBrowserState"
i18n-content="defaultBrowserUnknown"></div>
+ <div id="autoLaunchOption" class="checkbox" hidden>
+ <label>
+ <input id="autoLaunch" type="checkbox">
+ <span i18n-content="autoLaunchText"></span>
+ </input>
+ </label>
+ </div>
</div>
</section>
</if>
diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js
index ba59d3d..294bb9d 100644
--- a/chrome/browser/resources/options/browser_options.js
+++ b/chrome/browser/resources/options/browser_options.js
@@ -113,6 +113,9 @@ cr.define('options', function() {
$('defaultBrowserUseAsDefaultButton').onclick = function(event) {
chrome.send('becomeDefaultBrowser');
};
+
+ $('autoLaunch').addEventListener('click',
+ this.handleAutoLaunchChanged_);
}
var startupPagesList = $('startupPagesList');
@@ -282,7 +285,7 @@ cr.define('options', function() {
},
/**
- * 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 @@ cr.define('options', function() {
},
/**
- * 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 @@ cr.define('options', function() {
},
/**
+ * 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 @@ cr.define('options', function() {
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 @@ cr.define('options', function() {
BrowserOptions.getInstance().updateAutocompleteSuggestions_(suggestions);
};
+ BrowserOptions.updateAutoLaunchState = function(enabled) {
+ BrowserOptions.getInstance().updateAutoLaunchState_(enabled);
+ };
+
BrowserOptions.setInstantFieldTrialStatus = function(enabled) {
BrowserOptions.getInstance().setInstantFieldTrialStatus_(enabled);
};