OLD | NEW |
1 <link rel="import" href="chrome://resources/html/i18n_behavior.html"> | 1 <link rel="import" href="chrome://resources/html/i18n_behavior.html"> |
2 <link rel="import" href="chrome://resources/html/md_select_css.html"> | 2 <link rel="import" href="chrome://resources/html/md_select_css.html"> |
3 <link rel="import" href="chrome://resources/html/polymer.html"> | 3 <link rel="import" href="chrome://resources/html/polymer.html"> |
4 <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-f
lex-layout-classes.html"> | 4 <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-f
lex-layout-classes.html"> |
5 <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-ani
matable.html"> | 5 <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-ani
matable.html"> |
6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-butt
on.html"> | 6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-butt
on.html"> |
7 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper
-icon-button-light.html"> | 7 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper
-icon-button-light.html"> |
8 <link rel="import" href="appearance_browser_proxy.html"> | 8 <link rel="import" href="appearance_browser_proxy.html"> |
9 <link rel="import" href="../controls/controlled_radio_button.html"> | 9 <link rel="import" href="../controls/controlled_radio_button.html"> |
10 <link rel="import" href="../controls/extension_controlled_indicator.html"> | 10 <link rel="import" href="../controls/extension_controlled_indicator.html"> |
11 <link rel="import" href="../controls/settings_dropdown_menu.html"> | 11 <link rel="import" href="../controls/settings_dropdown_menu.html"> |
12 <link rel="import" href="../controls/settings_radio_group.html"> | 12 <link rel="import" href="../controls/settings_radio_group.html"> |
13 <link rel="import" href="../controls/settings_toggle_button.html"> | 13 <link rel="import" href="../controls/settings_toggle_button.html"> |
14 <link rel="import" href="../route.html"> | 14 <link rel="import" href="../route.html"> |
15 <link rel="import" href="../settings_page/settings_animated_pages.html"> | 15 <link rel="import" href="../settings_page/settings_animated_pages.html"> |
16 <link rel="import" href="../settings_page/settings_subpage.html"> | 16 <link rel="import" href="../settings_page/settings_subpage.html"> |
17 <link rel="import" href="../settings_shared_css.html"> | 17 <link rel="import" href="../settings_shared_css.html"> |
18 <link rel="import" href="../settings_vars_css.html"> | 18 <link rel="import" href="../settings_vars_css.html"> |
19 <link rel="import" href="appearance_fonts_page.html"> | 19 <link rel="import" href="appearance_fonts_page.html"> |
20 <link rel="import" href="home_url_input.html"> | 20 <link rel="import" href="home_url_input.html"> |
21 | 21 |
22 <dom-module id="settings-appearance-page"> | 22 <dom-module id="settings-appearance-page"> |
23 <template> | 23 <template> |
24 <style include="settings-shared md-select iron-flex"> | 24 <style include="settings-shared md-select iron-flex"> |
| 25 /* Conditional logic makes identifying the first settings-box complicated |
| 26 so use first-of-type here. */ |
| 27 settings-box:first-of-type { |
| 28 border-top: none; |
| 29 } |
| 30 |
25 .secondary-button ~ .secondary-button { | 31 .secondary-button ~ .secondary-button { |
26 -webkit-margin-start: 12px; | 32 -webkit-margin-start: 12px; |
27 } | 33 } |
28 | 34 |
29 #custom-input { | 35 #custom-input { |
30 margin-bottom: 1rem; | 36 margin-bottom: 1rem; |
31 } | 37 } |
32 | 38 |
33 #customHomePage { | 39 #customHomePage { |
34 --paper-input-container: { | 40 --paper-input-container: { |
35 width: 200px; | 41 width: 200px; |
36 }; | 42 }; |
37 width: 100%; /* Pushes policy indicators to end. */ | 43 width: 100%; /* Pushes policy indicators to end. */ |
38 } | 44 } |
39 </style> | 45 </style> |
40 <settings-animated-pages id="pages" section="appearance" | 46 <settings-animated-pages id="pages" section="appearance" |
41 focus-config="[[focusConfig_]]"> | 47 focus-config="[[focusConfig_]]"> |
42 <neon-animatable route-path="default"> | 48 <neon-animatable route-path="default"> |
43 <if expr="chromeos"> | 49 <if expr="chromeos"> |
44 <div class="settings-box first two-line" id="wallpaperButton" | 50 <template is="dom-if" if="[[showPage_(pageVisibility.setWallpaper)]]"> |
45 on-tap="openWallpaperManager_" actionable | 51 <div id="setWallpaper" class="settings-box two-line" |
46 hidden="[[!pageVisibility.setWallpaper]]"> | 52 on-tap="openWallpaperManager_" actionable> |
47 <div class="start"> | 53 <div class="start"> |
48 $i18n{setWallpaper} | 54 $i18n{setWallpaper} |
49 <div class="secondary" id="wallpaperSecondary"> | 55 <div class="secondary" id="wallpaperSecondary"> |
50 $i18n{openWallpaperApp} | 56 $i18n{openWallpaperApp} |
51 </div> | |
52 </div> | |
53 <button class="icon-external" is="paper-icon-button-light" | |
54 aria-label="$i18n{setWallpaper}" | |
55 aria-describedby="wallpaperSecondary"></button> | |
56 </div> | |
57 <div class="settings-box two-line" | |
58 hidden="[[!pageVisibility.setTheme]]"> | |
59 </if> | |
60 <if expr="not chromeos"> | |
61 <div class="settings-box two-line first" | |
62 hidden="[[!pageVisibility.setTheme]]"> | |
63 </if> | |
64 <a class="start two-line inherit-color no-outline" tabindex="-1" | |
65 target="_blank" href$="[[getThemeHref_(themeUrl_)]]"> | |
66 <div class="flex"> | |
67 $i18n{themes} | |
68 <div class="secondary" id="themesSecondary"> | |
69 [[themeSublabel_]] | |
70 </div> | 57 </div> |
71 </div> | 58 </div> |
72 <button class="icon-external" is="paper-icon-button-light" | 59 <button class="icon-external" is="paper-icon-button-light" |
73 actionable aria-label="$i18n{themes}" | 60 aria-label="$i18n{setWallpaper}" |
74 aria-describedby="themesSecondary"></button> | 61 aria-describedby="wallpaperSecondary"> |
75 </a> | 62 </button> |
| 63 </div> |
| 64 </template> |
| 65 </if> |
| 66 <template is="dom-if" if="[[showPage_(pageVisibility.setTheme)]]"> |
| 67 <div id="setTheme" class="settings-box two-line"> |
| 68 <a class="start two-line inherit-color no-outline" tabindex="-1" |
| 69 target="_blank" href$="[[getThemeHref_(themeUrl_)]]"> |
| 70 <div class="flex"> |
| 71 $i18n{themes} |
| 72 <div class="secondary" id="themesSecondary"> |
| 73 [[themeSublabel_]] |
| 74 </div> |
| 75 </div> |
| 76 <button class="icon-external" is="paper-icon-button-light" |
| 77 actionable aria-label="$i18n{themes}" |
| 78 aria-describedby="themesSecondary"> |
| 79 </button> |
| 80 </a> |
76 <if expr="not is_linux or chromeos"> | 81 <if expr="not is_linux or chromeos"> |
77 <template is="dom-if" if="[[prefs.extensions.theme.id.value]]"> | 82 <template is="dom-if" if="[[prefs.extensions.theme.id.value]]"> |
78 <div class="separator"></div> | 83 <div class="separator"></div> |
79 <paper-button id="useDefault" on-tap="onUseDefaultTap_" | 84 <paper-button id="useDefault" on-tap="onUseDefaultTap_" |
80 class="secondary-button"> | 85 class="secondary-button"> |
81 $i18n{resetToDefaultTheme} | 86 $i18n{resetToDefaultTheme} |
82 </paper-button> | 87 </paper-button> |
83 </template> | 88 </template> |
84 </if> | 89 </if> |
85 <if expr="is_linux and not chromeos"> | 90 <if expr="is_linux and not chromeos"> |
86 <div class="layout horizontal center" hidden="[[!showThemesSecondary_( | 91 <div class="layout horizontal center" |
87 prefs.extensions.theme.id.value, useSystemTheme_)]]" | 92 hidden="[[!showThemesSecondary_( |
88 id="themesSecondaryActions"> | 93 prefs.extensions.theme.id.value, useSystemTheme_)]]" |
89 <div class="separator"></div> | 94 id="themesSecondaryActions"> |
90 <template is="dom-if" if="[[showUseClassic_( | 95 <div class="separator"></div> |
91 prefs.extensions.theme.id.value, useSystemTheme_)]]" restamp> | 96 <template is="dom-if" if="[[showUseClassic_( |
92 <paper-button id="useDefault" on-tap="onUseDefaultTap_" | 97 prefs.extensions.theme.id.value, useSystemTheme_)]]" restamp> |
93 class="secondary-button"> | 98 <paper-button id="useDefault" on-tap="onUseDefaultTap_" |
94 $i18n{useClassicTheme} | 99 class="secondary-button"> |
95 </paper-button> | 100 $i18n{useClassicTheme} |
96 </template> | 101 </paper-button> |
97 <template is="dom-if" if="[[showUseSystem_( | 102 </template> |
98 prefs.extensions.theme.id.value, useSystemTheme_)]]" restamp> | 103 <template is="dom-if" if="[[showUseSystem_( |
99 <paper-button id="useSystem" on-tap="onUseSystemTap_" | 104 prefs.extensions.theme.id.value, useSystemTheme_)]]" restamp> |
100 class="secondary-button"> | 105 <paper-button id="useSystem" on-tap="onUseSystemTap_" |
101 $i18n{useSystemTheme} | 106 class="secondary-button"> |
102 </paper-button> | 107 $i18n{useSystemTheme} |
103 </template> | 108 </paper-button> |
104 </div> | 109 </template> |
| 110 </div> |
105 </if> | 111 </if> |
106 </div> | |
107 <div class="settings-box" | |
108 hidden="[[!pageVisibility.homeButton]]"> | |
109 <settings-toggle-button class="start" elide-label | |
110 pref="{{prefs.browser.show_home_button}}" | |
111 label="$i18n{showHomeButton}" | |
112 sub-label="[[getShowHomeSubLabel_( | |
113 prefs.browser.show_home_button.value, | |
114 prefs.homepage_is_newtabpage.value, | |
115 prefs.homepage.value)]]"> | |
116 </settings-toggle-button> | |
117 </div> | |
118 <template is="dom-if" if="[[prefs.browser.show_home_button.value]]"> | |
119 <div class="list-frame" hidden="[[!pageVisibility.homeButton]]"> | |
120 <settings-radio-group pref="{{prefs.homepage_is_newtabpage}}"> | |
121 <controlled-radio-button class="list-item" name="true" | |
122 pref="[[prefs.homepage_is_newtabpage]]" | |
123 label="$i18n{homePageNtp}" no-extension-indicator> | |
124 </controlled-radio-button> | |
125 <controlled-radio-button id="custom-input" class="list-item" | |
126 name="false" pref="[[prefs.homepage_is_newtabpage]]" | |
127 no-extension-indicator> | |
128 <!-- TODO(dbeam): this can show double indicators when both | |
129 homepage and whether to use the NTP as the homepage are | |
130 managed. --> | |
131 <home-url-input id="customHomePage" pref="{{prefs.homepage}}" | |
132 can-tab="[[!prefs.homepage_is_newtabpage.value]]"> | |
133 </home-url-input> | |
134 </controlled-radio-button> | |
135 <template is="dom-if" if="[[prefs.homepage.extensionId]]"> | |
136 <extension-controlled-indicator | |
137 extension-id="[[prefs.homepage.extensionId]]" | |
138 extension-can-be-disabled="[[ | |
139 prefs.homepage.extensionCanBeDisabled]]" | |
140 extension-name="[[prefs.homepage.controlledByName]]" | |
141 on-disable-extension="onDisableExtension_"> | |
142 </extension-controlled-indicator> | |
143 </template> | |
144 </settings-radio-group> | |
145 </div> | 112 </div> |
146 </template> | 113 </template> |
147 <div class="settings-box" | 114 <template is="dom-if" if="[[showPage_(pageVisibility.homeButton)]]"> |
148 hidden="[[!pageVisibility.bookmarksBar]]"> | 115 <div id="homeButton" class="settings-box"> |
149 <settings-toggle-button class="start" | 116 <settings-toggle-button class="start" elide-label |
150 pref="{{prefs.bookmark_bar.show_on_all_tabs}}" | 117 pref="{{prefs.browser.show_home_button}}" |
151 label="$i18n{showBookmarksBar}"> | 118 label="$i18n{showHomeButton}" |
152 </settings-toggle-button> | 119 sub-label="[[getShowHomeSubLabel_( |
153 </div> | 120 prefs.browser.show_home_button.value, |
154 <div class$="settings-box [[getFirst_(pageVisibility.bookmarksBar)]]"> | 121 prefs.homepage_is_newtabpage.value, |
| 122 prefs.homepage.value)]]"> |
| 123 </settings-toggle-button> |
| 124 </div> |
| 125 <template is="dom-if" if="[[prefs.browser.show_home_button.value]]"> |
| 126 <div class="list-frame"> |
| 127 <settings-radio-group pref="{{prefs.homepage_is_newtabpage}}"> |
| 128 <controlled-radio-button class="list-item" name="true" |
| 129 pref="[[prefs.homepage_is_newtabpage]]" |
| 130 label="$i18n{homePageNtp}" no-extension-indicator> |
| 131 </controlled-radio-button> |
| 132 <controlled-radio-button id="custom-input" class="list-item" |
| 133 name="false" pref="[[prefs.homepage_is_newtabpage]]" |
| 134 no-extension-indicator> |
| 135 <!-- TODO(dbeam): this can show double indicators when both |
| 136 homepage and whether to use the NTP as the homepage are |
| 137 managed. --> |
| 138 <home-url-input id="customHomePage" pref="{{prefs.homepage}}" |
| 139 can-tab="[[!prefs.homepage_is_newtabpage.value]]"> |
| 140 </home-url-input> |
| 141 </controlled-radio-button> |
| 142 <template is="dom-if" if="[[prefs.homepage.extensionId]]"> |
| 143 <extension-controlled-indicator |
| 144 extension-id="[[prefs.homepage.extensionId]]" |
| 145 extension-can-be-disabled="[[ |
| 146 prefs.homepage.extensionCanBeDisabled]]" |
| 147 extension-name="[[prefs.homepage.controlledByName]]" |
| 148 on-disable-extension="onDisableExtension_"> |
| 149 </extension-controlled-indicator> |
| 150 </template> |
| 151 </settings-radio-group> |
| 152 </div> |
| 153 </template> |
| 154 </template> |
| 155 <template is="dom-if" if="[[showPage_(pageVisibility.bookmarksBar)]]"> |
| 156 <div id="bookmarksBar" class="settings-box"> |
| 157 <settings-toggle-button class="start" |
| 158 pref="{{prefs.bookmark_bar.show_on_all_tabs}}" |
| 159 label="$i18n{showBookmarksBar}"> |
| 160 </settings-toggle-button> |
| 161 </div> |
| 162 </template> |
155 <if expr="is_linux and not chromeos"> | 163 <if expr="is_linux and not chromeos"> |
| 164 <div class$="settings-box"> |
156 <settings-toggle-button class="start" | 165 <settings-toggle-button class="start" |
157 pref="{{prefs.browser.custom_chrome_frame}}" | 166 pref="{{prefs.browser.custom_chrome_frame}}" |
158 label="$i18n{showWindowDecorations}" | 167 label="$i18n{showWindowDecorations}" |
159 inverted> | 168 inverted> |
160 </settings-toggle-button> | 169 </settings-toggle-button> |
161 </div> | 170 </div> |
| 171 </if> |
162 <div class="settings-box"> | 172 <div class="settings-box"> |
163 </if> | |
164 <div class="start">$i18n{fontSize}</div> | 173 <div class="start">$i18n{fontSize}</div> |
165 <settings-dropdown-menu id="defaultFontSize" label="$i18n{fontSize}" | 174 <settings-dropdown-menu id="defaultFontSize" label="$i18n{fontSize}" |
166 pref="{{prefs.webkit.webprefs.default_font_size}}" | 175 pref="{{prefs.webkit.webprefs.default_font_size}}" |
167 menu-options="[[fontSizeOptions_]]"> | 176 menu-options="[[fontSizeOptions_]]"> |
168 </settings-dropdown-menu> | 177 </settings-dropdown-menu> |
169 </div> | 178 </div> |
170 <div id="customize-fonts-subpage-trigger" class="settings-box" | 179 <div id="customize-fonts-subpage-trigger" class="settings-box" |
171 on-tap="onCustomizeFontsTap_" actionable> | 180 on-tap="onCustomizeFontsTap_" actionable> |
172 <div class="start"> | 181 <div class="start"> |
173 $i18n{customizeFonts} | 182 $i18n{customizeFonts} |
174 </div> | 183 </div> |
175 <button class="subpage-arrow" is="paper-icon-button-light" | 184 <button class="subpage-arrow" is="paper-icon-button-light" |
176 aria-label="$i18n{customizeFonts}"></button> | 185 aria-label="$i18n{customizeFonts}"></button> |
177 </div> | 186 </div> |
178 <div class="settings-box" hidden="[[!pageVisibility.pageZoom]]"> | 187 <template is="dom-if" if="[[showPage_(pageVisibility.pageZoom)]]"> |
179 <div id="pageZoom" class="start">$i18n{pageZoom}</div> | 188 <div class="settings-box"> |
180 <div class="md-select-wrapper"> | 189 <div id="pageZoom" class="start">$i18n{pageZoom}</div> |
181 <select id="zoomLevel" class="md-select" aria-labelledby="pageZoom" | 190 <div class="md-select-wrapper"> |
182 on-change="onZoomLevelChange_"> | 191 <select id="zoomLevel" class="md-select" |
183 <template is="dom-repeat" items="[[pageZoomLevels_]]"> | 192 aria-labelledby="pageZoom" |
184 <option value="[[item]]" | 193 on-change="onZoomLevelChange_"> |
185 selected="[[zoomValuesEqual_(item, defaultZoom_)]]"> | 194 <template is="dom-repeat" items="[[pageZoomLevels_]]"> |
186 [[formatZoom_(item)]]% | 195 <option value="[[item]]" |
187 </option> | 196 selected="[[zoomValuesEqual_(item, defaultZoom_)]]"> |
188 </template> | 197 [[formatZoom_(item)]]% |
189 </select> | 198 </option> |
190 <span class="md-select-underline"></span> | 199 </template> |
| 200 </select> |
| 201 <span class="md-select-underline"></span> |
| 202 </div> |
191 </div> | 203 </div> |
192 </div> | 204 </template> |
193 </neon-animatable> | 205 </neon-animatable> |
194 <template is="dom-if" route-path="/fonts"> | 206 <template is="dom-if" route-path="/fonts"> |
195 <settings-subpage | 207 <settings-subpage |
196 associated-control="[[$$('#customize-fonts-subpage-trigger')]]" | 208 associated-control="[[$$('#customize-fonts-subpage-trigger')]]" |
197 page-title="$i18n{customizeFonts}"> | 209 page-title="$i18n{customizeFonts}"> |
198 <settings-appearance-fonts-page prefs="{{prefs}}"> | 210 <settings-appearance-fonts-page prefs="{{prefs}}"> |
199 </settings-appearance-fonts-page> | 211 </settings-appearance-fonts-page> |
200 </settings-subpage> | 212 </settings-subpage> |
201 </template> | 213 </template> |
202 </settings-animated-pages> | 214 </settings-animated-pages> |
203 </template> | 215 </template> |
204 <script src="appearance_page.js"></script> | 216 <script src="appearance_page.js"></script> |
205 </dom-module> | 217 </dom-module> |
OLD | NEW |