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

Side by Side Diff: chrome/browser/resources/local_ntp/local_ntp_design.js

Issue 447243003: [Local NTP] Adding NtpDesign class to parametrizing NTP design specs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Making titleTextAlign optional; cleanups. Created 6 years, 4 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
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2
3
4 /**
5 * @fileoverview Specifications for the NTP design, and an accessor to presets.
6 */
7
8
9 /**
10 * Specifications for an NTP design (not comprehensive).
11 *
12 * name: A unique identifier for the style.
13 * classToAdd: A list of classes to be added to #ntp-contents, so the
14 * appropriate CSS will take effect.
15 * fontFamily: Font family to use for title and thumbnail <iframe>s.
16 * fontSize: Font size to use for the <iframe>s, in px.
17 * tileWidth: The width of each suggestion tile, in px.
18 * tileMargin: Spacing between successive tiles, in px.
19 * titleWidth: The width of each title <iframe>, in px.
20 * titleHeight: The height of each title <iframe>, in px.
21 * titleColor: The RRGGBB color of title text.
22 * titleTextAlign: (Optional) The alignment of title text. If unspecified, the
23 * default value is 'center'.
24 * titleTextFade: (Optional) The number of pixels beyond which title
25 * text begins to fade. This overrides the default ellipsis style.
26 * thumbnailWidth: The width of each thumbnail <iframe>, in px.
27 * thumbnailHeight: The height of each thumbnail <iframe>, in px.
28 * thumbnailTextColor: The RRGGBB color that thumbnail <iframe> may use to
29 * display text message in place of missing thumbnail.
30 *
31 * @typedef {{
32 * name: string,
33 * classToAdd: Array.{string},
34 * fontFamily: string,
35 * fontSize: number,
36 * tileWidth: number,
37 * tileMargin: number,
38 * titleWidth: number,
39 * titleHeight: number,
40 * titleColor: string,
41 * titleTextAlign: string|null|undefined,
42 * titleTextFade: string|null|undefined,
43 * thumbnailWidth: number,
44 * thumbnailHeight: number,
45 * thumbnailTextColor: string
46 * }}
47 */
48 var NtpDesign;
49
50 /**
51 * Returns an NTP design corresponding to the given name.
52 * @param {string|undefined} opt_name The name of the design. If undefined, then
53 * the default design is specified.
54 * @return {NtpDesign} The NTP design corresponding to name.
55 */
56 function getNtpDesign(opt_name) {
57 // TODO(huangs): Add new style.
58 return {
59 name: 'classical',
60 classToAdd: [],
61 fontFamily: 'arial, sans-serif',
62 fontSize: 11,
63 tileWidth: 140,
64 tileMargin: 20,
65 titleWidth: 138,
66 titleHeight: 18,
67 titleColor: '777777',
68 // No titleTextAlign: defaults to 'center'.
69 // No titleTextFade: by default we have ellipsis.
70 thumbnailWidth: 138,
71 thumbnailHeight: 83,
72 thumbnailTextColor: '777777'
73 };
74 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698