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

Side by Side Diff: chrome/browser/resources/settings/site_settings_page/site_settings_page.js

Issue 2984843003: MD Settings: Convert all usages of .bind(this) to use ES6 arrow function. (Closed)
Patch Set: Resolve conflicts. Created 3 years, 4 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 | « chrome/browser/resources/settings/site_settings/usb_devices.js ('k') | no next file » | 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 /** 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 [R.SITE_SETTINGS_POPUPS, 'popups'], 81 [R.SITE_SETTINGS_POPUPS, 'popups'],
82 [R.SITE_SETTINGS_BACKGROUND_SYNC, 'background-sync'], 82 [R.SITE_SETTINGS_BACKGROUND_SYNC, 'background-sync'],
83 [R.SITE_SETTINGS_AUTOMATIC_DOWNLOADS, 'automatic-downloads'], 83 [R.SITE_SETTINGS_AUTOMATIC_DOWNLOADS, 'automatic-downloads'],
84 [R.SITE_SETTINGS_UNSANDBOXED_PLUGINS, 'unsandboxed-plugins'], 84 [R.SITE_SETTINGS_UNSANDBOXED_PLUGINS, 'unsandboxed-plugins'],
85 [R.SITE_SETTINGS_HANDLERS, 'protocol-handlers'], 85 [R.SITE_SETTINGS_HANDLERS, 'protocol-handlers'],
86 [R.SITE_SETTINGS_MIDI_DEVICES, 'midi-devices'], 86 [R.SITE_SETTINGS_MIDI_DEVICES, 'midi-devices'],
87 [R.SITE_SETTINGS_ADS, 'ads'], [R.SITE_SETTINGS_ZOOM_LEVELS, 'zoom-levels'], 87 [R.SITE_SETTINGS_ADS, 'ads'], [R.SITE_SETTINGS_ZOOM_LEVELS, 'zoom-levels'],
88 [R.SITE_SETTINGS_USB_DEVICES, 'usb-devices'], 88 [R.SITE_SETTINGS_USB_DEVICES, 'usb-devices'],
89 [R.SITE_SETTINGS_PDF_DOCUMENTS, 'pdf-documents'], 89 [R.SITE_SETTINGS_PDF_DOCUMENTS, 'pdf-documents'],
90 [R.SITE_SETTINGS_PROTECTED_CONTENT, 'protected-content'], 90 [R.SITE_SETTINGS_PROTECTED_CONTENT, 'protected-content'],
91 ].forEach(function(pair) { 91 ].forEach(pair => {
92 var route = pair[0]; 92 var route = pair[0];
93 var id = pair[1]; 93 var id = pair[1];
94 this.focusConfig.set(route.path, '* /deep/ #' + id + ' .subpage-arrow'); 94 this.focusConfig.set(route.path, '* /deep/ #' + id + ' .subpage-arrow');
95 }.bind(this)); 95 });
96 }, 96 },
97 97
98 /** @override */ 98 /** @override */
99 ready: function() { 99 ready: function() {
100 this.ContentSettingsTypes = settings.ContentSettingsTypes; 100 this.ContentSettingsTypes = settings.ContentSettingsTypes;
101 this.ALL_SITES = settings.ALL_SITES; 101 this.ALL_SITES = settings.ALL_SITES;
102 102
103 var keys = Object.keys(settings.ContentSettingsTypes); 103 var keys = Object.keys(settings.ContentSettingsTypes);
104 for (var i = 0; i < keys.length; ++i) { 104 for (var i = 0; i < keys.length; ++i) {
105 var key = settings.ContentSettingsTypes[keys[i]]; 105 var key = settings.ContentSettingsTypes[keys[i]];
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 return other; 139 return other;
140 return enabled; 140 return enabled;
141 }, 141 },
142 142
143 /** 143 /**
144 * @param {string} category The category to update. 144 * @param {string} category The category to update.
145 * @private 145 * @private
146 */ 146 */
147 updateDefaultValueLabel_: function(category) { 147 updateDefaultValueLabel_: function(category) {
148 this.browserProxy.getDefaultValueForContentType(category).then( 148 this.browserProxy.getDefaultValueForContentType(category).then(
149 function(defaultValue) { 149 defaultValue => {
150 this.set( 150 this.set(
151 'default_.' + Polymer.CaseMap.dashToCamelCase(category), 151 'default_.' + Polymer.CaseMap.dashToCamelCase(category),
152 defaultValue.setting); 152 defaultValue.setting);
153 }.bind(this)); 153 });
154 }, 154 },
155 155
156 /** 156 /**
157 * The protocol handlers have a separate enabled/disabled notifier. 157 * The protocol handlers have a separate enabled/disabled notifier.
158 * @param {boolean} enabled 158 * @param {boolean} enabled
159 * @private 159 * @private
160 */ 160 */
161 updateHandlersEnabled_: function(enabled) { 161 updateHandlersEnabled_: function(enabled) {
162 var category = settings.ContentSettingsTypes.PROTOCOL_HANDLERS; 162 var category = settings.ContentSettingsTypes.PROTOCOL_HANDLERS;
163 this.set( 163 this.set(
164 'default_.' + Polymer.CaseMap.dashToCamelCase(category), 164 'default_.' + Polymer.CaseMap.dashToCamelCase(category),
165 enabled ? settings.ContentSetting.ALLOW : 165 enabled ? settings.ContentSetting.ALLOW :
166 settings.ContentSetting.BLOCK); 166 settings.ContentSetting.BLOCK);
167 }, 167 },
168 168
169 /** 169 /**
170 * Navigate to the route specified in the event dataset. 170 * Navigate to the route specified in the event dataset.
171 * @param {!Event} event The tap event. 171 * @param {!Event} event The tap event.
172 * @private 172 * @private
173 */ 173 */
174 onTapNavigate_: function(event) { 174 onTapNavigate_: function(event) {
175 var dataSet = /** @type {{route: string}} */ (event.currentTarget.dataset); 175 var dataSet = /** @type {{route: string}} */ (event.currentTarget.dataset);
176 settings.navigateTo(settings.routes[dataSet.route]); 176 settings.navigateTo(settings.routes[dataSet.route]);
177 }, 177 },
178 }); 178 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/site_settings/usb_devices.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698