Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 | 6 * @fileoverview |
| 7 * 'settings-site-settings-page' is the settings page containing privacy and | 7 * 'settings-site-settings-page' is the settings page containing privacy and |
| 8 * security site settings. | 8 * security site settings. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 }, | 42 }, |
| 43 | 43 |
| 44 /** @private */ | 44 /** @private */ |
| 45 enableSafeBrowsingSubresourceFilter_: { | 45 enableSafeBrowsingSubresourceFilter_: { |
| 46 type: Boolean, | 46 type: Boolean, |
| 47 value: function() { | 47 value: function() { |
| 48 return loadTimeData.getBoolean('enableSafeBrowsingSubresourceFilter'); | 48 return loadTimeData.getBoolean('enableSafeBrowsingSubresourceFilter'); |
| 49 } | 49 } |
| 50 }, | 50 }, |
| 51 | 51 |
| 52 /** @type {!Map<string, string>} */ | |
| 53 focusConfig: Object, | |
| 52 }, | 54 }, |
| 53 | 55 |
| 54 /** @override */ | 56 /** @override */ |
| 55 ready: function() { | 57 ready: function() { |
| 56 this.ContentSettingsTypes = settings.ContentSettingsTypes; | 58 this.ContentSettingsTypes = settings.ContentSettingsTypes; |
| 57 this.ALL_SITES = settings.ALL_SITES; | 59 this.ALL_SITES = settings.ALL_SITES; |
| 58 | 60 |
| 59 var keys = Object.keys(settings.ContentSettingsTypes); | 61 var keys = Object.keys(settings.ContentSettingsTypes); |
| 60 for (var i = 0; i < keys.length; ++i) { | 62 for (var i = 0; i < keys.length; ++i) { |
| 61 var key = settings.ContentSettingsTypes[keys[i]]; | 63 var key = settings.ContentSettingsTypes[keys[i]]; |
| 62 // Default labels are not applicable to USB and ZOOM. | 64 // Default labels are not applicable to USB and ZOOM. |
| 63 if (key == settings.ContentSettingsTypes.USB_DEVICES || | 65 if (key == settings.ContentSettingsTypes.USB_DEVICES || |
| 64 key == settings.ContentSettingsTypes.ZOOM_LEVELS) | 66 key == settings.ContentSettingsTypes.ZOOM_LEVELS) |
| 65 continue; | 67 continue; |
| 66 // Some values are not available (and will DCHECK) in guest mode. | 68 // Some values are not available (and will DCHECK) in guest mode. |
| 67 if (this.isGuest_ && | 69 if (this.isGuest_ && |
| 68 key == settings.ContentSettingsTypes.PROTOCOL_HANDLERS) { | 70 key == settings.ContentSettingsTypes.PROTOCOL_HANDLERS) { |
| 69 continue; | 71 continue; |
| 70 } | 72 } |
| 71 this.updateDefaultValueLabel_(key); | 73 this.updateDefaultValueLabel_(key); |
| 72 } | 74 } |
| 73 | 75 |
| 74 this.addWebUIListener( | 76 this.addWebUIListener( |
| 75 'contentSettingCategoryChanged', | 77 'contentSettingCategoryChanged', |
| 76 this.updateDefaultValueLabel_.bind(this)); | 78 this.updateDefaultValueLabel_.bind(this)); |
| 77 this.addWebUIListener( | 79 this.addWebUIListener( |
| 78 'setHandlersEnabled', | 80 'setHandlersEnabled', |
| 79 this.updateHandlersEnabled_.bind(this)); | 81 this.updateHandlersEnabled_.bind(this)); |
| 80 this.browserProxy.observeProtocolHandlersEnabledState(); | 82 this.browserProxy.observeProtocolHandlersEnabledState(); |
| 83 | |
| 84 var getDeepSelector = function(selector) { | |
| 85 return '* /deep/ ' + selector; | |
| 86 }; | |
|
Dan Beam
2017/04/12 01:05:26
'getDeepSelector()'.length > "'* /deep/ ".length
dpapad
2017/04/12 02:05:28
Not applicable anymore.
| |
| 87 | |
| 88 this.focusConfig.set( | |
|
Dan Beam
2017/04/12 01:05:26
why does this object already exist?
dpapad
2017/04/12 02:05:28
This is now explained in the comment. The |focusCo
| |
| 89 settings.Route.SITE_SETTINGS_COOKIES.path, | |
| 90 getDeepSelector('#cookies .subpage-arrow')); | |
|
Dan Beam
2017/04/12 01:05:26
can we just inline the /deep/ calls?
'* /deep/ #c
dpapad
2017/04/12 02:05:28
See latest patch.
| |
| 91 this.focusConfig.set( | |
| 92 settings.Route.SITE_SETTINGS_LOCATION.path, | |
| 93 getDeepSelector('#location .subpage-arrow')); | |
| 94 this.focusConfig.set( | |
| 95 settings.Route.SITE_SETTINGS_CAMERA.path, | |
| 96 getDeepSelector('#camera .subpage-arrow')); | |
| 97 this.focusConfig.set( | |
| 98 settings.Route.SITE_SETTINGS_MICROPHONE.path, | |
| 99 getDeepSelector('#microphone .subpage-arrow')); | |
| 81 }, | 100 }, |
| 82 | 101 |
| 83 /** | 102 /** |
| 84 * @param {string} setting Value from settings.PermissionValues. | 103 * @param {string} setting Value from settings.PermissionValues. |
| 85 * @param {string} enabled Non-block label ('feature X not allowed'). | 104 * @param {string} enabled Non-block label ('feature X not allowed'). |
| 86 * @param {string} disabled Block label (likely just, 'Blocked'). | 105 * @param {string} disabled Block label (likely just, 'Blocked'). |
| 87 * @param {?string} other Tristate value (maybe, 'session only'). | 106 * @param {?string} other Tristate value (maybe, 'session only'). |
| 88 * @private | 107 * @private |
| 89 */ | 108 */ |
| 90 defaultSettingLabel_: function(setting, enabled, disabled, other) { | 109 defaultSettingLabel_: function(setting, enabled, disabled, other) { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 127 /** | 146 /** |
| 128 * Navigate to the route specified in the event dataset. | 147 * Navigate to the route specified in the event dataset. |
| 129 * @param {!Event} event The tap event. | 148 * @param {!Event} event The tap event. |
| 130 * @private | 149 * @private |
| 131 */ | 150 */ |
| 132 onTapNavigate_: function(event) { | 151 onTapNavigate_: function(event) { |
| 133 var dataSet = /** @type {{route: string}} */(event.currentTarget.dataset); | 152 var dataSet = /** @type {{route: string}} */(event.currentTarget.dataset); |
| 134 settings.navigateTo(settings.Route[dataSet.route]); | 153 settings.navigateTo(settings.Route[dataSet.route]); |
| 135 }, | 154 }, |
| 136 }); | 155 }); |
| OLD | NEW |