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>} */ | |
|
Dan Beam
2017/04/12 02:32:02
@override maybe?
dpapad
2017/04/12 03:22:52
Tried @override and compiler seems to be happy eit
| |
| 53 focusConfig: { | |
| 54 type: Object, | |
| 55 observer: 'focusConfigChanged_', | |
| 56 }, | |
| 57 }, | |
| 58 | |
| 59 /** | |
| 60 * @param {!Map<string, string>} current | |
|
Dan Beam
2017/04/12 02:32:02
nit: newConfig, oldConfig
dpapad
2017/04/12 03:22:52
Done.
| |
| 61 * @param {?Map<string, string>} previous | |
| 62 * @private | |
| 63 */ | |
| 64 focusConfigChanged_: function(current, previous) { | |
| 65 if (previous != undefined) { | |
| 66 // Should never happen since focusConfig is set only once on the parent. | |
| 67 return; | |
| 68 } | |
|
Dan Beam
2017/04/12 02:32:02
assert(!oldConfig);
dpapad
2017/04/12 03:22:52
Done.
| |
| 69 | |
| 70 // Populate the |focusConfig| map of the parent <settings-animated-pages> | |
| 71 // element, with additional entries that correspond to subpage trigger | |
| 72 // elements residing in this element's Shadow DOM. | |
|
dpapad
2017/04/12 02:05:28
Populating this.focusConfig only after it is set t
| |
| 73 var R = settings.Route; | |
| 74 [ | |
| 75 [R.SITE_SETTINGS_COOKIES, 'cookies'], | |
| 76 [R.SITE_SETTINGS_LOCATION, 'location'], | |
| 77 [R.SITE_SETTINGS_CAMERA, 'camera'], | |
| 78 [R.SITE_SETTINGS_MICROPHONE, 'microphone'], | |
| 79 [R.SITE_SETTINGS_NOTIFICATIONS, 'notifications'], | |
| 80 [R.SITE_SETTINGS_JAVASCRIPT,'javascript'], | |
| 81 [R.SITE_SETTINGS_FLASH,'flash'], | |
| 82 [R.SITE_SETTINGS_IMAGES,'images'], | |
| 83 [R.SITE_SETTINGS_POPUPS,'popups'], | |
| 84 [R.SITE_SETTINGS_BACKGROUND_SYNC,'background-sync'], | |
| 85 [R.SITE_SETTINGS_AUTOMATIC_DOWNLOADS,'automatic-downloads'], | |
| 86 [R.SITE_SETTINGS_UNSANDBOXED_PLUGINS,'unsandboxed-plugins'], | |
| 87 [R.SITE_SETTINGS_HANDLERS,'protocol-handlers'], | |
| 88 [R.SITE_SETTINGS_MIDI_DEVICES,'midi-devices'], | |
| 89 [R.SITE_SETTINGS_SUBRESOURCE_FILTER,'subresource-filter'], | |
| 90 [R.SITE_SETTINGS_ZOOM_LEVELS,'zoom-levels'], | |
| 91 [R.SITE_SETTINGS_USB_DEVICES,'usb-devices'], | |
| 92 [R.SITE_SETTINGS_PDF_DOCUMENTS,'pdf-documents'], | |
| 93 [R.SITE_SETTINGS_PROTECTED_CONTENT,'protected-content'], | |
| 94 ].forEach(function(pair) { | |
| 95 var route = pair[0]; | |
| 96 var id = pair[1]; | |
| 97 this.focusConfig.set( | |
| 98 route.path, '* /deep/ #' + id + ' .subpage-arrow'); | |
| 99 }.bind(this)); | |
| 52 }, | 100 }, |
| 53 | 101 |
| 54 /** @override */ | 102 /** @override */ |
| 55 ready: function() { | 103 ready: function() { |
| 56 this.ContentSettingsTypes = settings.ContentSettingsTypes; | 104 this.ContentSettingsTypes = settings.ContentSettingsTypes; |
| 57 this.ALL_SITES = settings.ALL_SITES; | 105 this.ALL_SITES = settings.ALL_SITES; |
| 58 | 106 |
| 59 var keys = Object.keys(settings.ContentSettingsTypes); | 107 var keys = Object.keys(settings.ContentSettingsTypes); |
| 60 for (var i = 0; i < keys.length; ++i) { | 108 for (var i = 0; i < keys.length; ++i) { |
| 61 var key = settings.ContentSettingsTypes[keys[i]]; | 109 var key = settings.ContentSettingsTypes[keys[i]]; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 127 /** | 175 /** |
| 128 * Navigate to the route specified in the event dataset. | 176 * Navigate to the route specified in the event dataset. |
| 129 * @param {!Event} event The tap event. | 177 * @param {!Event} event The tap event. |
| 130 * @private | 178 * @private |
| 131 */ | 179 */ |
| 132 onTapNavigate_: function(event) { | 180 onTapNavigate_: function(event) { |
| 133 var dataSet = /** @type {{route: string}} */(event.currentTarget.dataset); | 181 var dataSet = /** @type {{route: string}} */(event.currentTarget.dataset); |
| 134 settings.navigateTo(settings.Route[dataSet.route]); | 182 settings.navigateTo(settings.Route[dataSet.route]); |
| 135 }, | 183 }, |
| 136 }); | 184 }); |
| OLD | NEW |