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

Side by Side Diff: chrome/browser/resources/settings/site_settings/constants.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
« no previous file with comments | « no previous file | chrome/browser/resources/settings/site_settings/site_details_permission.html » ('j') | 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 cr.define('settings', function() { 5 cr.define('settings', function() {
6 /** 6 /**
7 * The possible contentSettingsTypes (the ones we currently support 7 * The possible contentSettingsTypes (the ones we currently support
8 * configuring in the UI). This is a subset of the constants found under 8 * configuring in the UI). This is a subset of the constants found under
9 * content_setttings_types.h and the values should be kept in sync. 9 * content_setttings_types.h and the values should be kept in sync.
10 * TODO(finnur): When all categories have been implemented we can just 10 * TODO(finnur): When all categories have been implemented we can just
11 * generate these constants from content_setttings_types.h. 11 * generate these constants from content_setttings_types.h.
12 * @enum {number} 12 * @enum {number}
13 */ 13 */
14 var ContentSettingsTypes = { 14 var ContentSettingsTypes = {
15 COOKIES: 0, 15 COOKIES: 0,
16 IMAGES: 1, 16 IMAGES: 1,
17 JAVASCRIPT: 2, 17 JAVASCRIPT: 2,
18 POPUPS: 4, 18 POPUPS: 4,
19 GEOLOCATION: 5, 19 GEOLOCATION: 5,
20 NOTIFICATIONS: 6, 20 NOTIFICATIONS: 6,
21 FULLSCREEN: 8, 21 FULLSCREEN: 8,
22 MIC: 12, 22 MIC: 12,
23 CAMERA: 13, 23 CAMERA: 13,
24 }; 24 };
25 25
26 /** 26 /**
27 * Contains the possible values for a given contentSettingsType.
28 * @enum {number}
29 */
30 var PermissionValues = {
31 ALLOW: 1,
32 BLOCK: 2,
33 ASK: 3,
34 };
35
36 /**
37 * Contains the possible string values for a given contentSettingsType. 27 * Contains the possible string values for a given contentSettingsType.
38 * @enum {string} 28 * @enum {string}
39 */ 29 */
40 var PermissionStringValues = { 30 var PermissionValues = {
31 DEFAULT: 'default',
41 ALLOW: 'allow', 32 ALLOW: 'allow',
42 BLOCK: 'block', 33 BLOCK: 'block',
34 ASK: 'ask',
43 }; 35 };
44 36
45 /** 37 /**
46 * A category value to use for the All Sites list. 38 * A category value to use for the All Sites list.
47 * @const {number} 39 * @const {number}
48 */ 40 */
49 var ALL_SITES = -1; 41 var ALL_SITES = -1;
50 42
51 /** 43 /**
52 * An invalid subtype value. 44 * An invalid subtype value.
53 * @const {number} 45 * @const {string}
54 */ 46 */
55 var INVALID_CATEGORY_SUBTYPE = -1; 47 var INVALID_CATEGORY_SUBTYPE = '';
56 48
57 return { 49 return {
58 ContentSettingsTypes: ContentSettingsTypes, 50 ContentSettingsTypes: ContentSettingsTypes,
59 PermissionValues: PermissionValues, 51 PermissionValues: PermissionValues,
60 PermissionStringValues: PermissionStringValues,
61 ALL_SITES: ALL_SITES, 52 ALL_SITES: ALL_SITES,
62 INVALID_CATEGORY_SUBTYPE: INVALID_CATEGORY_SUBTYPE, 53 INVALID_CATEGORY_SUBTYPE: INVALID_CATEGORY_SUBTYPE,
63 }; 54 };
64 }); 55 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/settings/site_settings/site_details_permission.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698