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

Side by Side Diff: chrome/browser/resources/settings/settings_drawer/settings_drawer.js

Issue 1130113005: Convert cr-settings-drawer to Polymer 0.8 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ConvertSettingsMenu
Patch Set: Types Created 5 years, 7 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
OLDNEW
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-drawer' holds the user card and navigation menu for settings 7 * 'cr-settings-drawer' holds the user card and navigation menu for settings
8 * pages. 8 * pages.
9 * 9 *
10 * Example: 10 * Example:
11 * 11 *
12 * <core-drawer-panel> 12 * <paper-drawer-panel>
13 * <cr-settings-drawer drawer selectedId="{{selectedId}}" 13 * <cr-settings-drawer drawer selected-id="{{selectedId}}"
14 * pages="{{pages}}"> 14 * pages="[[pages]]">
15 * </cr-settings-drawer> 15 * </cr-settings-drawer>
16 * <cr-settings-main main selectedId="{{selectedId}}" pages="{{pages}}"> 16 * <cr-settings-main main selected-id="{{selectedId}}" pages="[[pages]]">
17 * </cr-settings-main> 17 * </cr-settings-main>
18 * </core-drawer-panel> 18 * </paper-drawer-panel>
19 * 19 *
20 * @group Chrome Settings Elements 20 * @group Chrome Settings Elements
21 * @element cr-settings-drawer 21 * @element cr-settings-drawer
22 */ 22 */
23 Polymer('cr-settings-drawer', { 23 Polymer({
24 publish: { 24 is: 'cr-settings-drawer',
25
26 properties: {
25 /** 27 /**
26 * Pages to include in the navigation. 28 * Pages to include in the navigation.
27 * 29 * @type {!Array<!HTMLElement>}
28 * @attribute pages
29 * @type Array<!Object>
30 * @default null
31 */ 30 */
32 pages: null, 31 pages: {
32 type: Array,
33 value: function() { return []; },
34 },
33 35
34 /** 36 /**
35 * ID of the currently selected page. 37 * ID of the currently selected page.
36 * 38 * @type {string}
37 * @attribute selectedId
38 * @type string
39 * default ''
40 */ 39 */
41 selectedId: '', 40 selectedId: {
42 }, 41 type: String,
42 notify: true,
43 },
43 44
44 /** @override */ 45 /**
45 created: function() { 46 * @type {!Object}
46 this.pages = []; 47 * @private
47 }, 48 * TODO(michaelpg): Create custom element and data source for user card.
48 49 */
49 /** 50 user_: {
50 * @type {Object} 51 type: Object,
51 * TODO(michaelpg): Create custom element and data source for user card. 52 value: function() {
52 */ 53 return {
53 user: { 54 name: 'Chrome User',
54 name: 'Chrome User', 55 email: 'user@example.com',
55 email: 'user@example.com', 56 iconUrl: 'chrome://theme/IDR_PROFILE_AVATAR_23@1x',
56 iconUrl: 'chrome://theme/IDR_PROFILE_AVATAR_23@1x', 57 };
58 },
59 notify: true,
Jeremy Klein 2015/05/12 23:35:16 Why does this need to notify? Can it be readonly?
michaelpg 2015/05/13 00:54:26 Done.
60 },
57 }, 61 },
58 }); 62 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698