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

Side by Side Diff: chrome/browser/resources/settings/settings_page/settings_section.js

Issue 1241363002: Settings Rewrite: Make a common settings-section component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0300-webui-settings-structure
Patch Set: Created 5 years, 5 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
(Empty)
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.
4
5 /**
6 * @fileoverview
7 * 'cr-settings-section' shows a paper material themed section with a header
8 * which shows its page title and icon. Note, the page title and icon are not
9 * bound properties, but are instead directly retrieved from the content
10 * element.
11 *
12 * Example:
13 *
14 * <cr-settings-section>
15 * <!-- Insert your section controls here -->
16 * </cr-settings-section>
17 *
18 * @group Chrome Settings Elements
19 * @element cr-settings-section
20 */
21 Polymer({
22 is: 'cr-settings-section',
23
24 ready: function() {
25 // We use this trickery to retrieve the content page's title and icon, as
26 // Polymer does not support directly binding content element properties.
27 var contentElement = this.getContentChildren()[0];
28 if (contentElement != undefined &&
29 contentElement.properties != undefined) {
30 // Page title value is defined as a function.
31 this.pageTitle = contentElement.properties.pageTitle.value();
32 // Icon value is defined as a property.
33 this.icon = contentElement.properties.icon.value;
Dan Beam 2015/07/22 23:12:17 why are we setting titles in JS vs just with i18n-
michaelpg 2015/07/22 23:26:55 basically we bound the header to the title of the
34 }
35 }
36 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698