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

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

Issue 7563018: Merge 95301 - Options: Fix the startup pages list. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/835/src/
Patch Set: Created 9 years, 5 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 | « no previous file | chrome/browser/resources/options/inline_editable_list.js » ('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 95304)
+++ chrome/browser/resources/options/browser_options.js (working copy)
@@ -63,6 +63,14 @@
$('toolbarShowBookmarksBar').onchange = function() {
chrome.send('toggleShowBookmarksBar');
};
+ var items = document.querySelectorAll('input[name=startup]');
+ for (i = 0; i < items.length; i++) {
+ items[i].onchange = function(event) {
+ chrome.send('setRestoreOnStartup', [event.target.value]);
+ chrome.send('coreOptionsUserMetricsAction',
+ [event.target.getAttribute('metric')]);
+ };
+ }
$('defaultSearchManageEnginesButton').onclick = function(event) {
OptionsPage.navigateToPage('searchEngines');
chrome.send('coreOptionsUserMetricsAction',
@@ -258,6 +266,21 @@
},
/**
+ * Updates the startup radio group with the given value.
+ * @param {number} value the preference value being set.
+ * @private
+ */
+ updateRestoreOnStartup_: function(value) {
+ var items = document.querySelectorAll('input[name=startup]');
+ for (i = 0; i < items.length; i++) {
+ if (items[i].value == value)
+ items[i].checked = true;
+ }
+
+ this.updateCustomStartupPageControlStates_();
+ },
+
+ /**
* Updates the startup pages list with the given entries.
* @param {Array} pages List of startup pages.
* @private
@@ -510,6 +533,10 @@
defaultManaged);
};
+ BrowserOptions.updateRestoreOnStartup = function(value) {
+ BrowserOptions.getInstance().updateRestoreOnStartup_(value);
+ };
+
BrowserOptions.updateStartupPages = function(pages) {
BrowserOptions.getInstance().updateStartupPages_(pages);
};
« no previous file with comments | « no previous file | chrome/browser/resources/options/inline_editable_list.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698