1 // Copyright 2015 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.
6 * @fileoverview 'cr-settings-startup-urls-page' is the settings page
7 * containing the urls that will be opened when chrome is started.
11 * <neon-animated-pages>
12 * <cr-settings-startup-urls-page prefs="{{prefs}}">
13 * </cr-settings-startup-urls-page>
15 * </neon-animated-pages>
17 * @group Chrome Settings Elements
18 * @element cr-settings-startup-urls-page
21 is: 'cr-settings-startup-urls-page',
41 * Whether the page is a subpage.
54 value: 'startup-urls',
59 * Title for the page header and navigation menu.
63 value: loadTimeData.getString('onStartupSetPages'),
68 * Name of the 'core-icon' to be shown in the settings-page-header.
72 value: 'image:brightness-1',
80 /** @type {!Array<string>} */
83 value: function() { return []; }
87 attached: function() {
88 this.savedUrlList = this.prefs.session.startup_urls.value.slice();
92 onUseCurrentPagesTap_: function() {
93 // TODO(dschuyler): I'll be making a chrome.send call here.
97 onCancelTap_: function() {
98 this.set('prefs.session.startup_urls.value', this.savedUrlList.slice());
102 onOkTap_: function() {
103 var value = this.newUrl && this.newUrl.trim();
106 this.push('prefs.session.startup_urls.value', value);
107 this.newUrl = undefined;
111 onRemoveUrlTap_: function(e) {
112 this.splice('prefs.session.startup_urls.value', e.model.index, 1);