Chromium Code Reviews| 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 { | |
|
dpapad
2017/05/03 23:02:24
I don't think this works at all. :first-of-type ca
stevenjb
2017/05/03 23:31:43
Ugh, you're right. It's super subtle when at the t
stevenjb
2017/05/03 23:33:16
Oh, ugh, I need to check [hidden] also... one mome
stevenjb
2017/05/03 23:36:51
aaaaand this only works with dom-if, right. Which
| |
| 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 <div class="settings-box two-line" id="setWallpaper" |
| 45 on-tap="openWallpaperManager_" actionable | 51 on-tap="openWallpaperManager_" actionable |
| 46 hidden="[[!pageVisibility.setWallpaper]]"> | 52 hidden="[[!showPage_(pageVisibility.setWallpaper)]]"> |
|
dpapad
2017/05/03 23:02:24
Isn't this equivalent to what is already on the le
stevenjb
2017/05/03 23:31:43
The change makes this more robust and, imho, more
| |
| 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> | 57 </div> |
| 52 </div> | 58 </div> |
| 53 <button class="icon-external" is="paper-icon-button-light" | 59 <button class="icon-external" is="paper-icon-button-light" |
| 54 aria-label="$i18n{setWallpaper}" | 60 aria-label="$i18n{setWallpaper}" |
| 55 aria-describedby="wallpaperSecondary"></button> | 61 aria-describedby="wallpaperSecondary"></button> |
| 56 </div> | 62 </div> |
| 57 <div class="settings-box two-line" | |
| 58 hidden="[[!pageVisibility.setTheme]]"> | |
| 59 </if> | 63 </if> |
| 60 <if expr="not chromeos"> | 64 <div id="setTheme" class="settings-box two-line" |
| 61 <div class="settings-box two-line first" | 65 hidden="[[!showPage_(pageVisibility.setTheme)]]"> |
| 62 hidden="[[!pageVisibility.setTheme]]"> | |
| 63 </if> | |
| 64 <a class="start two-line inherit-color no-outline" tabindex="-1" | 66 <a class="start two-line inherit-color no-outline" tabindex="-1" |
| 65 target="_blank" href$="[[getThemeHref_(themeUrl_)]]"> | 67 target="_blank" href$="[[getThemeHref_(themeUrl_)]]"> |
| 66 <div class="flex"> | 68 <div class="flex"> |
| 67 $i18n{themes} | 69 $i18n{themes} |
| 68 <div class="secondary" id="themesSecondary"> | 70 <div class="secondary" id="themesSecondary"> |
| 69 [[themeSublabel_]] | 71 [[themeSublabel_]] |
| 70 </div> | 72 </div> |
| 71 </div> | 73 </div> |
| 72 <button class="icon-external" is="paper-icon-button-light" | 74 <button class="icon-external" is="paper-icon-button-light" |
| 73 actionable aria-label="$i18n{themes}" | 75 actionable aria-label="$i18n{themes}" |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 97 <template is="dom-if" if="[[showUseSystem_( | 99 <template is="dom-if" if="[[showUseSystem_( |
| 98 prefs.extensions.theme.id.value, useSystemTheme_)]]" restamp> | 100 prefs.extensions.theme.id.value, useSystemTheme_)]]" restamp> |
| 99 <paper-button id="useSystem" on-tap="onUseSystemTap_" | 101 <paper-button id="useSystem" on-tap="onUseSystemTap_" |
| 100 class="secondary-button"> | 102 class="secondary-button"> |
| 101 $i18n{useSystemTheme} | 103 $i18n{useSystemTheme} |
| 102 </paper-button> | 104 </paper-button> |
| 103 </template> | 105 </template> |
| 104 </div> | 106 </div> |
| 105 </if> | 107 </if> |
| 106 </div> | 108 </div> |
| 107 <div class="settings-box" | 109 <div id="homeButton" class="settings-box" |
| 108 hidden="[[!pageVisibility.homeButton]]"> | 110 hidden="[[!showPage_(pageVisibility.homeButton)]]"> |
| 109 <settings-toggle-button class="start" elide-label | 111 <settings-toggle-button class="start" elide-label |
| 110 pref="{{prefs.browser.show_home_button}}" | 112 pref="{{prefs.browser.show_home_button}}" |
| 111 label="$i18n{showHomeButton}" | 113 label="$i18n{showHomeButton}" |
| 112 sub-label="[[getShowHomeSubLabel_( | 114 sub-label="[[getShowHomeSubLabel_( |
| 113 prefs.browser.show_home_button.value, | 115 prefs.browser.show_home_button.value, |
| 114 prefs.homepage_is_newtabpage.value, | 116 prefs.homepage_is_newtabpage.value, |
| 115 prefs.homepage.value)]]"> | 117 prefs.homepage.value)]]"> |
| 116 </settings-toggle-button> | 118 </settings-toggle-button> |
| 117 </div> | 119 </div> |
| 118 <template is="dom-if" if="[[prefs.browser.show_home_button.value]]"> | 120 <template is="dom-if" if="[[prefs.browser.show_home_button.value]]"> |
| 119 <div class="list-frame" hidden="[[!pageVisibility.homeButton]]"> | 121 <div class="list-frame" |
| 122 hidden="[[!showPage_(pageVisibility.homeButton)]]"> | |
| 120 <settings-radio-group pref="{{prefs.homepage_is_newtabpage}}"> | 123 <settings-radio-group pref="{{prefs.homepage_is_newtabpage}}"> |
| 121 <controlled-radio-button class="list-item" name="true" | 124 <controlled-radio-button class="list-item" name="true" |
| 122 pref="[[prefs.homepage_is_newtabpage]]" | 125 pref="[[prefs.homepage_is_newtabpage]]" |
| 123 label="$i18n{homePageNtp}" no-extension-indicator> | 126 label="$i18n{homePageNtp}" no-extension-indicator> |
| 124 </controlled-radio-button> | 127 </controlled-radio-button> |
| 125 <controlled-radio-button id="custom-input" class="list-item" | 128 <controlled-radio-button id="custom-input" class="list-item" |
| 126 name="false" pref="[[prefs.homepage_is_newtabpage]]" | 129 name="false" pref="[[prefs.homepage_is_newtabpage]]" |
| 127 no-extension-indicator> | 130 no-extension-indicator> |
| 128 <!-- TODO(dbeam): this can show double indicators when both | 131 <!-- TODO(dbeam): this can show double indicators when both |
| 129 homepage and whether to use the NTP as the homepage are | 132 homepage and whether to use the NTP as the homepage are |
| 130 managed. --> | 133 managed. --> |
| 131 <home-url-input id="customHomePage" pref="{{prefs.homepage}}" | 134 <home-url-input id="customHomePage" pref="{{prefs.homepage}}" |
| 132 can-tab="[[!prefs.homepage_is_newtabpage.value]]"> | 135 can-tab="[[!prefs.homepage_is_newtabpage.value]]"> |
| 133 </home-url-input> | 136 </home-url-input> |
| 134 </controlled-radio-button> | 137 </controlled-radio-button> |
| 135 <template is="dom-if" if="[[prefs.homepage.extensionId]]"> | 138 <template is="dom-if" if="[[prefs.homepage.extensionId]]"> |
| 136 <extension-controlled-indicator | 139 <extension-controlled-indicator |
| 137 extension-id="[[prefs.homepage.extensionId]]" | 140 extension-id="[[prefs.homepage.extensionId]]" |
| 138 extension-can-be-disabled="[[ | 141 extension-can-be-disabled="[[ |
| 139 prefs.homepage.extensionCanBeDisabled]]" | 142 prefs.homepage.extensionCanBeDisabled]]" |
| 140 extension-name="[[prefs.homepage.controlledByName]]" | 143 extension-name="[[prefs.homepage.controlledByName]]" |
| 141 on-disable-extension="onDisableExtension_"> | 144 on-disable-extension="onDisableExtension_"> |
| 142 </extension-controlled-indicator> | 145 </extension-controlled-indicator> |
| 143 </template> | 146 </template> |
| 144 </settings-radio-group> | 147 </settings-radio-group> |
| 145 </div> | 148 </div> |
| 146 </template> | 149 </template> |
| 147 <div class="settings-box" | 150 <div id="bookmarksBar" class="settings-box" |
| 148 hidden="[[!pageVisibility.bookmarksBar]]"> | 151 hidden="[[!showPage_(pageVisibility.bookmarksBar)]]"> |
| 149 <settings-toggle-button class="start" | 152 <settings-toggle-button class="start" |
| 150 pref="{{prefs.bookmark_bar.show_on_all_tabs}}" | 153 pref="{{prefs.bookmark_bar.show_on_all_tabs}}" |
| 151 label="$i18n{showBookmarksBar}"> | 154 label="$i18n{showBookmarksBar}"> |
| 152 </settings-toggle-button> | 155 </settings-toggle-button> |
| 153 </div> | 156 </div> |
| 154 <div class$="settings-box [[getFirst_(pageVisibility.bookmarksBar)]]"> | |
|
dpapad
2017/05/03 23:02:24
Isn't this addressing the problem of determining w
stevenjb
2017/05/03 23:31:43
The new CSS does the right thing now, always, rega
| |
| 155 <if expr="is_linux and not chromeos"> | 157 <if expr="is_linux and not chromeos"> |
| 158 <div class$="settings-box"> | |
| 156 <settings-toggle-button class="start" | 159 <settings-toggle-button class="start" |
| 157 pref="{{prefs.browser.custom_chrome_frame}}" | 160 pref="{{prefs.browser.custom_chrome_frame}}" |
| 158 label="$i18n{showWindowDecorations}" | 161 label="$i18n{showWindowDecorations}" |
| 159 inverted> | 162 inverted> |
| 160 </settings-toggle-button> | 163 </settings-toggle-button> |
| 161 </div> | 164 </div> |
| 165 </if> | |
| 162 <div class="settings-box"> | 166 <div class="settings-box"> |
| 163 </if> | |
| 164 <div class="start">$i18n{fontSize}</div> | 167 <div class="start">$i18n{fontSize}</div> |
| 165 <settings-dropdown-menu id="defaultFontSize" label="$i18n{fontSize}" | 168 <settings-dropdown-menu id="defaultFontSize" label="$i18n{fontSize}" |
| 166 pref="{{prefs.webkit.webprefs.default_font_size}}" | 169 pref="{{prefs.webkit.webprefs.default_font_size}}" |
| 167 menu-options="[[fontSizeOptions_]]"> | 170 menu-options="[[fontSizeOptions_]]"> |
| 168 </settings-dropdown-menu> | 171 </settings-dropdown-menu> |
| 169 </div> | 172 </div> |
| 170 <div id="customize-fonts-subpage-trigger" class="settings-box" | 173 <div id="customize-fonts-subpage-trigger" class="settings-box" |
| 171 on-tap="onCustomizeFontsTap_" actionable> | 174 on-tap="onCustomizeFontsTap_" actionable> |
| 172 <div class="start"> | 175 <div class="start"> |
| 173 $i18n{customizeFonts} | 176 $i18n{customizeFonts} |
| 174 </div> | 177 </div> |
| 175 <button class="subpage-arrow" is="paper-icon-button-light" | 178 <button class="subpage-arrow" is="paper-icon-button-light" |
| 176 aria-label="$i18n{customizeFonts}"></button> | 179 aria-label="$i18n{customizeFonts}"></button> |
| 177 </div> | 180 </div> |
| 178 <div class="settings-box" hidden="[[!pageVisibility.pageZoom]]"> | 181 <div class="settings-box" |
| 182 hidden="[[!showPage_(pageVisibility.pageZoom)]]"> | |
| 179 <div id="pageZoom" class="start">$i18n{pageZoom}</div> | 183 <div id="pageZoom" class="start">$i18n{pageZoom}</div> |
| 180 <div class="md-select-wrapper"> | 184 <div class="md-select-wrapper"> |
| 181 <select id="zoomLevel" class="md-select" aria-labelledby="pageZoom" | 185 <select id="zoomLevel" class="md-select" aria-labelledby="pageZoom" |
| 182 on-change="onZoomLevelChange_"> | 186 on-change="onZoomLevelChange_"> |
| 183 <template is="dom-repeat" items="[[pageZoomLevels_]]"> | 187 <template is="dom-repeat" items="[[pageZoomLevels_]]"> |
| 184 <option value="[[item]]" | 188 <option value="[[item]]" |
| 185 selected="[[zoomValuesEqual_(item, defaultZoom_)]]"> | 189 selected="[[zoomValuesEqual_(item, defaultZoom_)]]"> |
| 186 [[formatZoom_(item)]]% | 190 [[formatZoom_(item)]]% |
| 187 </option> | 191 </option> |
| 188 </template> | 192 </template> |
| 189 </select> | 193 </select> |
| 190 <span class="md-select-underline"></span> | 194 <span class="md-select-underline"></span> |
| 191 </div> | 195 </div> |
| 192 </div> | 196 </div> |
| 193 </neon-animatable> | 197 </neon-animatable> |
| 194 <template is="dom-if" route-path="/fonts"> | 198 <template is="dom-if" route-path="/fonts"> |
| 195 <settings-subpage | 199 <settings-subpage |
| 196 associated-control="[[$$('#customize-fonts-subpage-trigger')]]" | 200 associated-control="[[$$('#customize-fonts-subpage-trigger')]]" |
| 197 page-title="$i18n{customizeFonts}"> | 201 page-title="$i18n{customizeFonts}"> |
| 198 <settings-appearance-fonts-page prefs="{{prefs}}"> | 202 <settings-appearance-fonts-page prefs="{{prefs}}"> |
| 199 </settings-appearance-fonts-page> | 203 </settings-appearance-fonts-page> |
| 200 </settings-subpage> | 204 </settings-subpage> |
| 201 </template> | 205 </template> |
| 202 </settings-animated-pages> | 206 </settings-animated-pages> |
| 203 </template> | 207 </template> |
| 204 <script src="appearance_page.js"></script> | 208 <script src="appearance_page.js"></script> |
| 205 </dom-module> | 209 </dom-module> |
| OLD | NEW |