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

Side by Side Diff: chrome/browser/resources/options/startup_page_manager.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/options/startup_page_manager.html ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 cr.define('options', function() {
6 const OptionsPage = options.OptionsPage;
7 const ArrayDataModel = cr.ui.ArrayDataModel;
8 const ListSingleSelectionModel = cr.ui.ListSingleSelectionModel;
9
10 /**
11 * Encapsulated handling of startup page management page.
12 * @constructor
13 */
14 function StartupPageManager() {
15 this.activeNavTab = null;
16 OptionsPage.call(this, 'startupPages',
17 templateData.StartupPageManagerPage,
18 'startupPageManagerPage');
19 }
20
21 cr.addSingletonGetter(StartupPageManager);
22
23 StartupPageManager.prototype = {
24 __proto__: OptionsPage.prototype,
25 list_: null,
26
27 initializePage: function() {
28 OptionsPage.prototype.initializePage.call(this);
29
30 var list = $('startupPagesFullList');
31 options.browser_options.StartupPageList.decorate(list);
32 list.autoExpands = true;
33 list.selectionModel = new ListSingleSelectionModel;
34
35 // Wire up controls.
36 $('startupAddButton').onclick = function(event) {
37 OptionsPage.showOverlay('addStartupPageOverlay');
38 };
39
40 // Remove Windows-style accelerators from button labels.
41 // TODO(stuartmorgan): Remove this once the strings are updated.
42 $('startupAddButton').textContent =
43 localStrings.getStringWithoutAccelerator('startupAddButton');
44 },
45
46 /**
47 * Updates the startup pages list with the given entries.
48 * @param {Array} pages List of startup pages.
49 * @private
50 */
51 updateStartupPages_: function(pages) {
52 $('startupPagesFullList').dataModel = new ArrayDataModel(pages);
53 },
54
55 /**
56 * Adds the given startup page at the current selection point.
57 * @private
58 */
59 addStartupPage_: function(url) {
60 var firstSelection =
61 $('startupPagesFullList').selectionModel.selectedIndex;
62 chrome.send('addStartupPage', [url, String(firstSelection)]);
63 },
64 };
65
66 StartupPageManager.updateStartupPages = function(pages) {
67 StartupPageManager.getInstance().updateStartupPages_(pages);
68 };
69
70 StartupPageManager.addStartupPage = function(url) {
71 StartupPageManager.getInstance().addStartupPage_(url);
72 };
73
74 // Export
75 return {
76 StartupPageManager: StartupPageManager
77 };
78
79 });
80
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/startup_page_manager.html ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698