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

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

Issue 6292014: DOMUI Prefs: Remove the startup page managment sub-page (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-add accidentally removed CSS Created 9 years, 11 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
Index: chrome/browser/resources/options/browser_options.js
diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js
index d17d4432c9ff2e76a8547b909c8002a72feb22f2..9d70454de0166cad499301b01ce3f3fe0d764144 100644
--- a/chrome/browser/resources/options/browser_options.js
+++ b/chrome/browser/resources/options/browser_options.js
@@ -44,8 +44,8 @@ cr.define('options', function() {
$('startupUseCurrentButton').onclick = function(event) {
chrome.send('setStartupPagesToCurrentPages');
};
- $('startupPageManagerButton').onclick = function(event) {
- OptionsPage.showPageByName('startupPages');
+ $('startupAddButton').onclick = function(event) {
+ OptionsPage.showOverlay('addStartupPageOverlay');
};
$('defaultSearchManageEnginesButton').onclick = function(event) {
OptionsPage.showPageByName('searchEngines');
@@ -74,9 +74,14 @@ cr.define('options', function() {
// Ensure that changes are committed when closing the page.
window.addEventListener('unload', function() {
- if (document.activeElement == homepageField)
- homepageField.blur();
- });
+ if (document.activeElement == homepageField)
+ homepageField.blur();
+ });
+
+ // Remove Windows-style accelerators from button labels.
+ // TODO(stuartmorgan): Remove this once the strings are updated.
+ $('startupAddButton').textContent =
+ localStrings.getStringWithoutAccelerator('startupAddButton');
if (!cr.isChromeOS) {
$('defaultBrowserUseAsDefaultButton').onclick = function(event) {
@@ -84,7 +89,7 @@ cr.define('options', function() {
};
}
- var list = $('startupPagesShortList');
+ var list = $('startupPagesList');
options.browser_options.StartupPageList.decorate(list);
list.autoExpands = true;
list.selectionModel = new ListSingleSelectionModel;
@@ -169,19 +174,7 @@ cr.define('options', function() {
* @param {Array} pages List of startup pages.
*/
updateStartupPages_: function(pages) {
- var list = $('startupPagesShortList');
- list.dataModel = new ArrayDataModel(pages);
- if (pages.length > 0 && pages.length <= 10) {
- list.classList.remove("hidden");
- $('startupPageManagement').classList.add('settings-list');
- $('startupShowPagesLabel').textContent =
- localStrings.getStringWithoutAccelerator('startupShowPages');
- } else {
- list.classList.add("hidden");
- $('startupPageManagement').classList.remove('settings-list');
- $('startupShowPagesLabel').textContent =
- localStrings.getStringWithoutAccelerator('startupShowManyPages');
- }
+ $('startupPagesList').dataModel = new ArrayDataModel(pages);
},
/**
@@ -344,9 +337,9 @@ cr.define('options', function() {
*/
updateCustomStartupPageControlStates_: function() {
var disable = !this.shouldEnableCustomStartupPageControls_();
- $('startupPagesShortList').disabled = disable;
+ $('startupPagesList').disabled = disable;
$('startupUseCurrentButton').disabled = disable;
- $('startupPageManagerButton').disabled = disable;
+ $('startupAddButton').disabled = disable;
},
/**
@@ -360,6 +353,16 @@ cr.define('options', function() {
chrome.send('setDefaultSearchEngine', [String(selection.value)]);
}
},
+
+ /**
+ * Adds the given startup page at the current selection point.
+ * @private
+ */
+ addStartupPage_: function(url) {
+ var selectedIndex =
+ $('startupPagesList').selectionModel.selectedIndex;
+ chrome.send('addStartupPage', [url, String(selectedIndex)]);
+ },
};
BrowserOptions.updateDefaultBrowserState = function(statusString, isDefault,
@@ -377,7 +380,10 @@ cr.define('options', function() {
BrowserOptions.updateStartupPages = function(pages) {
BrowserOptions.getInstance().updateStartupPages_(pages);
- StartupPageManager.getInstance().updateStartupPages_(pages);
+ };
+
+ BrowserOptions.addStartupPage = function(url) {
+ BrowserOptions.getInstance().addStartupPage_(url);
};
// Export
« no previous file with comments | « chrome/browser/resources/options/browser_options.html ('k') | chrome/browser/resources/options/browser_options_page.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698