OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview | 6 * @fileoverview |
7 * 'cr-settings-downloads-page' is the settings page containing downloads | 7 * 'cr-settings-downloads-page' is the settings page containing downloads |
8 * settings. | 8 * settings. |
9 * | 9 * |
10 * Example: | 10 * Example: |
11 * | 11 * |
12 * <core-animated-pages> | 12 * <iron-animated-pages> |
13 * <cr-settings-downloads-page prefs="{{prefs}}"> | 13 * <cr-settings-downloads-page prefs="{{prefs}}"> |
14 * </cr-settings-downloads-page> | 14 * </cr-settings-downloads-page> |
15 * ... other pages ... | 15 * ... other pages ... |
16 * </core-animated-pages> | 16 * </iron-animated-pages> |
17 * | 17 * |
18 * @group Chrome Settings Elements | 18 * @group Chrome Settings Elements |
19 * @element cr-settings-downloads-page | 19 * @element cr-settings-downloads-page |
20 */ | 20 */ |
21 Polymer('cr-settings-downloads-page', { | 21 Polymer({ |
22 publish: { | 22 is: 'cr-settings-downloads-page', |
| 23 |
| 24 properties: { |
23 /** | 25 /** |
24 * Preferences state. | 26 * Preferences state. |
25 * | 27 * @type {?CrSettingsPrefsElement} |
26 * @attribute prefs | |
27 * @type CrSettingsPrefsElement | |
28 * @default null | |
29 */ | 28 */ |
30 prefs: null, | 29 prefs: { |
| 30 type: Object, |
| 31 notify: true, |
| 32 }, |
31 | 33 |
32 /** | 34 /** |
33 * Route for the page. | 35 * Route for the page. |
34 * | |
35 * @attribute route | |
36 * @type string | |
37 * @default '' | |
38 */ | 36 */ |
39 route: '', | 37 route: String, |
40 | 38 |
41 /** | 39 /** |
42 * Whether the page is a subpage. | 40 * Whether the page is a subpage. |
43 * | |
44 * @attribute subpage | |
45 * @type boolean | |
46 * @default false | |
47 */ | 41 */ |
48 subpage: false, | 42 subpage: { |
| 43 type: Boolean, |
| 44 value: false, |
| 45 readOnly: true, |
| 46 }, |
49 | 47 |
50 /** | 48 /** |
51 * ID of the page. | 49 * ID of the page. |
52 * | |
53 * @attribute PAGE_ID | |
54 * @const string | |
55 * @default 'downloads' | |
56 */ | 50 */ |
57 PAGE_ID: 'downloads', | 51 PAGE_ID: { |
| 52 type: String, |
| 53 value: 'downloads', |
| 54 readOnly: true, |
| 55 }, |
58 | 56 |
59 /** | 57 /** |
60 * Title for the page header and navigation menu. | 58 * Title for the page header and navigation menu. |
61 * | |
62 * @attribute pageTitle | |
63 * @type string | |
64 */ | 59 */ |
65 pageTitle: loadTimeData.getString('downloadsPageTitle'), | 60 pageTitle: { |
| 61 type: String, |
| 62 value: function() { |
| 63 return loadTimeData.getString('downloadsPageTitle'); |
| 64 }, |
| 65 }, |
66 | 66 |
67 /** | 67 /** |
68 * Name of the 'core-icon' to show. | 68 * Name of the 'iron-icon' to show. |
69 * | |
70 * @attribute icon | |
71 * @type string | |
72 * @default 'file-download' | |
73 */ | 69 */ |
74 icon: 'file-download', | 70 icon: { |
| 71 type: String, |
| 72 value: 'file-download', |
| 73 readOnly: true, |
| 74 }, |
75 }, | 75 }, |
76 | 76 |
77 selectDownloadLocation: function() { | 77 /** @private */ |
| 78 selectDownloadLocation_: function() { |
78 // TODO(orenb): Communicate with the C++ to actually display a folder | 79 // TODO(orenb): Communicate with the C++ to actually display a folder |
79 // picker. | 80 // picker. |
80 this.$.downloadsPath.value = '/Downloads'; | 81 this.$.downloadsPath.value = '/Downloads'; |
81 }, | 82 }, |
82 }); | 83 }); |
OLD | NEW |