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

Side by Side Diff: chrome/browser/resources/settings/appearance_page/appearance_page.js

Issue 2825493003: MD Settings: change outlinks to actually use <a> (Closed)
Patch Set: replace more Created 3 years, 8 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
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 3, 78 3,
79 4, 79 4,
80 5, 80 5,
81 ], 81 ],
82 }, 82 },
83 83
84 /** @private */ 84 /** @private */
85 themeSublabel_: String, 85 themeSublabel_: String,
86 86
87 /** @private */ 87 /** @private */
88 themeUrl_: String,
89
90 /** @private */
88 useSystemTheme_: { 91 useSystemTheme_: {
89 type: Boolean, 92 type: Boolean,
90 value: false, // Can only be true on Linux, but value exists everywhere. 93 value: false, // Can only be true on Linux, but value exists everywhere.
91 }, 94 },
92 95
93 /** @private {!Map<string, string>} */ 96 /** @private {!Map<string, string>} */
94 focusConfig_: { 97 focusConfig_: {
95 type: Object, 98 type: Object,
96 value: function() { 99 value: function() {
97 var map = new Map(); 100 var map = new Map();
98 map.set( 101 map.set(
99 settings.Route.FONTS.path, 102 settings.Route.FONTS.path,
100 '#customize-fonts-subpage-trigger .subpage-arrow'); 103 '#customize-fonts-subpage-trigger .subpage-arrow');
101 return map; 104 return map;
102 }, 105 },
103 }, 106 },
104 }, 107 },
105 108
106 /** @private {?settings.AppearanceBrowserProxy} */ 109 /** @private {?settings.AppearanceBrowserProxy} */
107 browserProxy_: null, 110 browserProxy_: null,
108 111
109 /** @private {string} */
110 themeUrl_: '',
111
112 observers: [ 112 observers: [
113 'themeChanged_(prefs.extensions.theme.id.value, useSystemTheme_)', 113 'themeChanged_(prefs.extensions.theme.id.value, useSystemTheme_)',
114 114
115 // <if expr="is_linux and not chromeos"> 115 // <if expr="is_linux and not chromeos">
116 // NOTE: this pref only exists on Linux. 116 // NOTE: this pref only exists on Linux.
117 'useSystemThemePrefChanged_(prefs.extensions.theme.use_system.value)', 117 'useSystemThemePrefChanged_(prefs.extensions.theme.use_system.value)',
118 // </if> 118 // </if>
119 ], 119 ],
120 120
121 created: function() { 121 created: function() {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 /** @private */ 158 /** @private */
159 onCustomizeFontsTap_: function() { 159 onCustomizeFontsTap_: function() {
160 settings.navigateTo(settings.Route.FONTS); 160 settings.navigateTo(settings.Route.FONTS);
161 }, 161 },
162 162
163 /** @private */ 163 /** @private */
164 onDisableExtension_: function() { 164 onDisableExtension_: function() {
165 this.fire('refresh-pref', 'homepage'); 165 this.fire('refresh-pref', 'homepage');
166 }, 166 },
167 167
168 /** @private */ 168 /** @private */
dschuyler 2017/04/18 23:22:44 comment like, "URL for either current theme or the
scottchen 2017/04/20 18:41:49 Acknowledged.
169 onThemesTap_: function() { 169 getThemeHref_: function() {
170 window.open(this.themeUrl_ || loadTimeData.getString('themesGalleryUrl')); 170 return this.themeUrl_ || loadTimeData.getString('themesGalleryUrl');
scottchen 2017/04/18 19:12:49 this.themeUrl_ contains a generated themes id, so
dpapad 2017/04/18 21:29:27 +dbeam: Should we be using https://cs.chromium.org
Dan Beam 2017/04/18 21:59:49 i wouldn't worry about it if you realllly want to
scottchen 2017/04/18 22:41:51 Acknowledged.
171 }, 171 },
172 172
173 // <if expr="chromeos"> 173 // <if expr="chromeos">
174 /** 174 /**
175 * ChromeOS only. 175 * ChromeOS only.
176 * @private 176 * @private
177 */ 177 */
178 openWallpaperManager_: function() { 178 openWallpaperManager_: function() {
179 this.browserProxy_.openWallpaperManager(); 179 this.browserProxy_.openWallpaperManager();
180 }, 180 },
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 this.browserProxy_.useSystemTheme(); 231 this.browserProxy_.useSystemTheme();
232 }, 232 },
233 // </if> 233 // </if>
234 234
235 /** 235 /**
236 * @param {string} themeId 236 * @param {string} themeId
237 * @param {boolean} useSystemTheme 237 * @param {boolean} useSystemTheme
238 * @private 238 * @private
239 */ 239 */
240 themeChanged_: function(themeId, useSystemTheme) { 240 themeChanged_: function(themeId, useSystemTheme) {
241 if (themeId) { 241 if (themeId) {
dschuyler 2017/04/18 23:22:44 If you check the themeId for the themeId_, this lo
242 assert(!useSystemTheme); 242 assert(!useSystemTheme);
243 243
244 this.browserProxy_.getThemeInfo(themeId).then(function(info) { 244 this.browserProxy_.getThemeInfo(themeId).then(function(info) {
245 this.themeSublabel_ = info.name; 245 this.themeSublabel_ = info.name;
246 }.bind(this)); 246 }.bind(this));
247 247
248 this.themeUrl_ = 'https://chrome.google.com/webstore/detail/' + themeId; 248 this.themeUrl_ = 'https://chrome.google.com/webstore/detail/' + themeId;
249 return; 249 return;
250 } 250 }
251 251
(...skipping 26 matching lines...) Expand all
278 * @see content::ZoomValuesEqual(). 278 * @see content::ZoomValuesEqual().
279 * @param {number} zoom1 279 * @param {number} zoom1
280 * @param {number} zoom2 280 * @param {number} zoom2
281 * @return {boolean} 281 * @return {boolean}
282 * @private 282 * @private
283 */ 283 */
284 zoomValuesEqual_: function(zoom1, zoom2) { 284 zoomValuesEqual_: function(zoom1, zoom2) {
285 return Math.abs(zoom1 - zoom2) <= 0.001; 285 return Math.abs(zoom1 - zoom2) <= 0.001;
286 }, 286 },
287 }); 287 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698