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

Side by Side Diff: chrome/browser/resources/settings/site_settings/site_settings_behavior.js

Issue 1959163002: MD Settings: use custom iconset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SettingsIcons
Patch Set: rebase Created 4 years, 7 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 * @fileoverview Behavior common to Site Settings classes. 6 * @fileoverview Behavior common to Site Settings classes.
7 */ 7 */
8 8
9 /** @polymerBehavior */ 9 /** @polymerBehavior */
10 var SiteSettingsBehaviorImpl = { 10 var SiteSettingsBehaviorImpl = {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 * A utility function to compute the icon to use for the category, both for 92 * A utility function to compute the icon to use for the category, both for
93 * the overall category as well as the individual permission in the details 93 * the overall category as well as the individual permission in the details
94 * for a site. 94 * for a site.
95 * @param {number} category The category to show the icon for. 95 * @param {number} category The category to show the icon for.
96 * @return {string} The id of the icon for the given category. 96 * @return {string} The id of the icon for the given category.
97 * @protected 97 * @protected
98 */ 98 */
99 computeIconForContentCategory: function(category) { 99 computeIconForContentCategory: function(category) {
100 switch (category) { 100 switch (category) {
101 case settings.ContentSettingsTypes.CAMERA: 101 case settings.ContentSettingsTypes.CAMERA:
102 return 'av:videocam'; 102 return 'settings:videocam';
103 case settings.ContentSettingsTypes.COOKIES: 103 case settings.ContentSettingsTypes.COOKIES:
104 return 'md-settings-icons:cookie'; 104 return 'settings:cookie';
105 case settings.ContentSettingsTypes.FULLSCREEN: 105 case settings.ContentSettingsTypes.FULLSCREEN:
106 return 'icons:fullscreen'; 106 return 'settings:fullscreen';
107 case settings.ContentSettingsTypes.GEOLOCATION: 107 case settings.ContentSettingsTypes.GEOLOCATION:
108 return 'communication:location-on'; 108 return 'settings:location-on';
109 case settings.ContentSettingsTypes.IMAGES: 109 case settings.ContentSettingsTypes.IMAGES:
110 return 'image:photo'; 110 return 'settings:photo';
111 case settings.ContentSettingsTypes.JAVASCRIPT: 111 case settings.ContentSettingsTypes.JAVASCRIPT:
112 return 'icons:input'; 112 return 'settings:input';
113 case settings.ContentSettingsTypes.MIC: 113 case settings.ContentSettingsTypes.MIC:
114 return 'av:mic'; 114 return 'settings:mic';
115 case settings.ContentSettingsTypes.NOTIFICATIONS: 115 case settings.ContentSettingsTypes.NOTIFICATIONS:
116 return 'social:notifications'; 116 return 'settings:notifications';
117 case settings.ContentSettingsTypes.POPUPS: 117 case settings.ContentSettingsTypes.POPUPS:
118 return 'icons:open-in-new'; 118 return 'settings:open-in-new';
119 default: 119 default:
120 assertNotReached('Invalid category: ' + category); 120 assertNotReached('Invalid category: ' + category);
121 return ''; 121 return '';
122 } 122 }
123 }, 123 },
124 124
125 /** 125 /**
126 * A utility function to compute the title of the category, both for 126 * A utility function to compute the title of the category, both for
127 * the overall category as well as the individual permission in the details 127 * the overall category as well as the individual permission in the details
128 * for a site. 128 * for a site.
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 * @private 258 * @private
259 */ 259 */
260 computeSiteIcon: function(site) { 260 computeSiteIcon: function(site) {
261 var url = this.ensureUrlHasScheme(site.originForDisplay); 261 var url = this.ensureUrlHasScheme(site.originForDisplay);
262 return 'background-image: ' + cr.icon.getFaviconImageSet(url); 262 return 'background-image: ' + cr.icon.getFaviconImageSet(url);
263 }, 263 },
264 }; 264 };
265 265
266 /** @polymerBehavior */ 266 /** @polymerBehavior */
267 var SiteSettingsBehavior = [SiteSettingsBehaviorImpl]; 267 var SiteSettingsBehavior = [SiteSettingsBehaviorImpl];
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698