Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 * 'settings-appearance-page' is the settings page containing appearance | 6 * 'settings-appearance-page' is the settings page containing appearance |
| 7 * settings. | 7 * settings. |
| 8 * | 8 * |
| 9 * Example: | 9 * Example: |
| 10 * | 10 * |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 <if expr="is_linux and not chromeos"> | 166 <if expr="is_linux and not chromeos"> |
| 167 /** | 167 /** |
| 168 * @param {boolean} useSystemTheme | 168 * @param {boolean} useSystemTheme |
| 169 * @private | 169 * @private |
| 170 */ | 170 */ |
| 171 useSystemThemePrefChanged_: function(useSystemTheme) { | 171 useSystemThemePrefChanged_: function(useSystemTheme) { |
| 172 this.useSystemTheme_ = useSystemTheme; | 172 this.useSystemTheme_ = useSystemTheme; |
| 173 }, | 173 }, |
| 174 | 174 |
| 175 /** | 175 /** |
| 176 * @param {string} themeId | |
| 177 * @param {boolean} useSystemTheme | |
| 178 * @return {boolean} Whether to show the "USE CLASSIC" button. | 176 * @return {boolean} Whether to show the "USE CLASSIC" button. |
| 179 * @private | 177 * @private |
| 180 */ | 178 */ |
| 181 showUseClassic_: function(themeId, useSystemTheme) { | 179 showUseClassic_: function() { |
| 182 return !!themeId || useSystemTheme; | 180 if (this.useSystemTheme_) |
| 181 return true; | |
| 182 return !!this.get('prefs.extensions.theme.id.value'); | |
|
dpapad
2016/10/18 17:49:34
Nit:
return this.useSystemTheme_ || !!this.get('pr
Dan Beam
2016/10/18 18:59:52
see updated code
| |
| 183 }, | 183 }, |
| 184 | 184 |
| 185 /** | 185 /** |
| 186 * @param {string} themeId | |
| 187 * @param {boolean} useSystemTheme | |
| 188 * @return {boolean} Whether to show the "USE GTK+" button. | 186 * @return {boolean} Whether to show the "USE GTK+" button. |
| 189 * @private | 187 * @private |
| 190 */ | 188 */ |
| 191 showUseSystem_: function(themeId, useSystemTheme) { | 189 showUseSystem_: function() { |
| 192 return !!themeId || !useSystemTheme; | 190 if (this.useSystemTheme_ || loadTimeData.getBoolean('isSupervised')) |
| 191 return false; | |
| 192 return !!this.get('prefs.extensions.theme.id.value'); | |
| 193 }, | |
| 194 | |
| 195 /** | |
| 196 * @return {boolean} Whether to show the secondary area where "USE CLASSIC" | |
| 197 * and "USE GTK+" buttons live. | |
| 198 * @private | |
| 199 */ | |
| 200 showThemesSecondary_: function() { | |
| 201 return this.showUseClassic_() || this.showUseSystem_(); | |
| 193 }, | 202 }, |
| 194 | 203 |
| 195 /** @private */ | 204 /** @private */ |
| 196 onUseSystemTap_: function() { | 205 onUseSystemTap_: function() { |
| 197 this.browserProxy_.useSystemTheme(); | 206 this.browserProxy_.useSystemTheme(); |
| 198 }, | 207 }, |
| 199 </if> | 208 </if> |
| 200 | 209 |
| 201 /** | 210 /** |
| 202 * @param {string} themeId | 211 * @param {string} themeId |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 234 | 243 |
| 235 /** | 244 /** |
| 236 * @param {boolean} bookmarksBarVisible if bookmarks bar option is visible. | 245 * @param {boolean} bookmarksBarVisible if bookmarks bar option is visible. |
| 237 * @return {string} 'first' if the argument is false or empty otherwise. | 246 * @return {string} 'first' if the argument is false or empty otherwise. |
| 238 * @private | 247 * @private |
| 239 */ | 248 */ |
| 240 getFirst_: function(bookmarksBarVisible) { | 249 getFirst_: function(bookmarksBarVisible) { |
| 241 return !bookmarksBarVisible ? 'first' : ''; | 250 return !bookmarksBarVisible ? 'first' : ''; |
| 242 } | 251 } |
| 243 }); | 252 }); |
| OLD | NEW |