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

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

Issue 1882793002: Site Settings: Use only string values for permissions on the JS side. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback Created 4 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 * @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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 this.browserProxy.resetCategoryPermissionForOrigin( 42 this.browserProxy.resetCategoryPermissionForOrigin(
43 primaryPattern, secondaryPattern, category); 43 primaryPattern, secondaryPattern, category);
44 }, 44 },
45 45
46 /** 46 /**
47 * Sets the category permission for a given origin. 47 * Sets the category permission for a given origin.
48 * @param {string} primaryPattern The primary pattern to change the permission 48 * @param {string} primaryPattern The primary pattern to change the permission
49 * for. 49 * for.
50 * @param {string} secondaryPattern The secondary pattern to change the 50 * @param {string} secondaryPattern The secondary pattern to change the
51 * permission for. 51 * permission for.
52 * @param {number} value What value to set the permission to.
53 * @param {number} category The category permission to change. 52 * @param {number} category The category permission to change.
53 * @param {string} value What value to set the permission to.
54 * @protected 54 * @protected
55 */ 55 */
56 setCategoryPermissionForOrigin: function( 56 setCategoryPermissionForOrigin: function(
57 primaryPattern, secondaryPattern, value, category) { 57 primaryPattern, secondaryPattern, category, value) {
58 this.browserProxy.setCategoryPermissionForOrigin( 58 this.browserProxy.setCategoryPermissionForOrigin(
59 primaryPattern, secondaryPattern, category, value); 59 primaryPattern, secondaryPattern, category, value);
60 }, 60 },
61 61
62 /** 62 /**
63 * A utility function to lookup a category name from its enum. 63 * A utility function to lookup a category name from its enum.
64 * @param {number} category The category ID to look up. 64 * @param {number} category The category ID to look up.
65 * @return {string} The category found or blank string if not found. 65 * @return {string} The category found or blank string if not found.
66 * @protected 66 * @protected
67 */ 67 */
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 * @return {string} The URL with a scheme, or an empty string. 291 * @return {string} The URL with a scheme, or an empty string.
292 */ 292 */
293 ensureUrlHasScheme: function(url) { 293 ensureUrlHasScheme: function(url) {
294 if (url.length == 0) return url; 294 if (url.length == 0) return url;
295 return url.includes('://') ? url : 'http://' + url; 295 return url.includes('://') ? url : 'http://' + url;
296 }, 296 },
297 }; 297 };
298 298
299 /** @polymerBehavior */ 299 /** @polymerBehavior */
300 var SiteSettingsBehavior = [SiteSettingsBehaviorImpl]; 300 var SiteSettingsBehavior = [SiteSettingsBehaviorImpl];
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698