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

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

Issue 2414213002: MD Settings: use theme homepage URLs when set (Closed)
Patch Set: ensure always CWS Created 4 years, 2 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
« no previous file with comments | « chrome/browser/resources/settings/appearance_page/appearance_page.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 /** @private */ 94 /** @private */
95 themeSublabel_: String, 95 themeSublabel_: String,
96 96
97 /** 97 /**
98 * Dictionary defining page visibility. 98 * Dictionary defining page visibility.
99 * @type {!AppearancePageVisibility} 99 * @type {!AppearancePageVisibility}
100 */ 100 */
101 pageVisibility: Object, 101 pageVisibility: Object,
102 }, 102 },
103 103
104 /** @private {string} */
105 themeUrl_: '',
106
104 observers: [ 107 observers: [
105 'themeChanged_(prefs.extensions.theme.id.value, useSystemTheme_)', 108 'themeChanged_(prefs.extensions.theme.id.value, useSystemTheme_)',
106 109
107 <if expr="is_linux and not chromeos"> 110 <if expr="is_linux and not chromeos">
108 // NOTE: this pref only exists on Linux. 111 // NOTE: this pref only exists on Linux.
109 'useSystemThemePrefChanged_(prefs.extensions.theme.use_system.value)', 112 'useSystemThemePrefChanged_(prefs.extensions.theme.use_system.value)',
110 </if> 113 </if>
111 114
112 'zoomLevelChanged_(defaultZoomLevel_.value)', 115 'zoomLevelChanged_(defaultZoomLevel_.value)',
113 ], 116 ],
(...skipping 22 matching lines...) Expand all
136 return this.i18n('homePageNtp'); 139 return this.i18n('homePageNtp');
137 return homepage || this.i18n('exampleDotCom'); 140 return homepage || this.i18n('exampleDotCom');
138 }, 141 },
139 142
140 /** @private */ 143 /** @private */
141 onCustomizeFontsTap_: function() { 144 onCustomizeFontsTap_: function() {
142 settings.navigateTo(settings.Route.FONTS); 145 settings.navigateTo(settings.Route.FONTS);
143 }, 146 },
144 147
145 /** @private */ 148 /** @private */
146 openThemesGallery_: function() { 149 onThemesTap_: function() {
147 // TODO(dbeam): open the theme detail page when a custom theme is installed 150 window.open(this.themeUrl_ || loadTimeData.getString('themesGalleryUrl'));
148 // (or otherwise handle the [//] open in new icon in a better way).
149 window.open(loadTimeData.getString('themesGalleryUrl'));
150 }, 151 },
151 152
152 <if expr="chromeos"> 153 <if expr="chromeos">
153 /** 154 /**
154 * ChromeOS only. 155 * ChromeOS only.
155 * @private 156 * @private
156 */ 157 */
157 openWallpaperManager_: function() { 158 openWallpaperManager_: function() {
158 this.browserProxy_.openWallpaperManager(); 159 this.browserProxy_.openWallpaperManager();
159 }, 160 },
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 </if> 201 </if>
201 202
202 /** 203 /**
203 * @param {string} themeId 204 * @param {string} themeId
204 * @param {boolean} useSystemTheme 205 * @param {boolean} useSystemTheme
205 * @private 206 * @private
206 */ 207 */
207 themeChanged_: function(themeId, useSystemTheme) { 208 themeChanged_: function(themeId, useSystemTheme) {
208 if (themeId) { 209 if (themeId) {
209 assert(!useSystemTheme); 210 assert(!useSystemTheme);
211
210 this.browserProxy_.getThemeInfo(themeId).then(function(info) { 212 this.browserProxy_.getThemeInfo(themeId).then(function(info) {
211 this.themeSublabel_ = info.name; 213 this.themeSublabel_ = info.name;
212 }.bind(this)); 214 }.bind(this));
215
216 this.themeUrl_ = `https://chrome.google.com/webstore/detail/${themeId}`;
213 return; 217 return;
214 } 218 }
215 219
216 var i18nId; 220 var i18nId;
217 <if expr="is_linux and not chromeos"> 221 <if expr="is_linux and not chromeos">
218 i18nId = useSystemTheme ? 'systemTheme' : 'classicTheme'; 222 i18nId = useSystemTheme ? 'systemTheme' : 'classicTheme';
219 </if> 223 </if>
220 <if expr="not is_linux or chromeos"> 224 <if expr="not is_linux or chromeos">
221 i18nId = 'chooseFromWebStore'; 225 i18nId = 'chooseFromWebStore';
222 </if> 226 </if>
223 this.themeSublabel_ = this.i18n(i18nId); 227 this.themeSublabel_ = this.i18n(i18nId);
228 this.themeUrl_ = '';
224 }, 229 },
225 230
226 /** 231 /**
227 * @param {number} percent The integer percentage of the page zoom. 232 * @param {number} percent The integer percentage of the page zoom.
228 * @private 233 * @private
229 */ 234 */
230 zoomPrefChanged_: function(percent) { 235 zoomPrefChanged_: function(percent) {
231 this.set('defaultZoomLevel_.value', percent); 236 this.set('defaultZoomLevel_.value', percent);
232 }, 237 },
233 238
(...skipping 10 matching lines...) Expand all
244 249
245 /** 250 /**
246 * @param {boolean} bookmarksBarVisible if bookmarks bar option is visible. 251 * @param {boolean} bookmarksBarVisible if bookmarks bar option is visible.
247 * @return {string} 'first' if the argument is false or empty otherwise. 252 * @return {string} 'first' if the argument is false or empty otherwise.
248 * @private 253 * @private
249 */ 254 */
250 getFirst_: function(bookmarksBarVisible) { 255 getFirst_: function(bookmarksBarVisible) {
251 return !bookmarksBarVisible ? 'first' : ''; 256 return !bookmarksBarVisible ? 'first' : '';
252 } 257 }
253 }); 258 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/appearance_page/appearance_page.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698