| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 * @unrestricted | 5 * @unrestricted |
| 6 */ | 6 */ |
| 7 Network.BlockedURLsPane = class extends UI.VBox { | 7 Network.BlockedURLsPane = class extends UI.VBox { |
| 8 constructor() { | 8 constructor() { |
| 9 super(true); | 9 super(true); |
| 10 this.registerRequiredCSS('network/blockedURLsPane.css'); | 10 this.registerRequiredCSS('network/blockedURLsPane.css'); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 193 |
| 194 var label = element.createChild('div', 'blocked-url-text'); | 194 var label = element.createChild('div', 'blocked-url-text'); |
| 195 label.textContent = url; | 195 label.textContent = url; |
| 196 | 196 |
| 197 var count = this._blockedRequestsCount(url); | 197 var count = this._blockedRequestsCount(url); |
| 198 var countElement = element.createChild('div', 'blocked-count monospace'); | 198 var countElement = element.createChild('div', 'blocked-count monospace'); |
| 199 countElement.textContent = String.sprintf('[%d]', count); | 199 countElement.textContent = String.sprintf('[%d]', count); |
| 200 countElement.title = Common.UIString( | 200 countElement.title = Common.UIString( |
| 201 count === 1 ? '%d request blocked by this pattern' : '%d requests blocke
d by this pattern', count); | 201 count === 1 ? '%d request blocked by this pattern' : '%d requests blocke
d by this pattern', count); |
| 202 | 202 |
| 203 var removeButton = element.createChild('div', 'remove-button'); | 203 var removeButton = UI.Icon.create('smallicon-cross', 'remove-icon'); |
| 204 element.appendChild(removeButton); |
| 204 removeButton.title = Common.UIString('Remove'); | 205 removeButton.title = Common.UIString('Remove'); |
| 205 removeButton.addEventListener('click', this._removeBlockedURL.bind(this, ind
ex), false); | 206 removeButton.addEventListener('click', this._removeBlockedURL.bind(this, ind
ex), false); |
| 206 | 207 |
| 207 element.addEventListener('contextmenu', this._contextMenu.bind(this, index),
true); | 208 element.addEventListener('contextmenu', this._contextMenu.bind(this, index),
true); |
| 208 element.addEventListener( | 209 element.addEventListener( |
| 209 'dblclick', this._edit.bind(this, url, element, this._changeBlockedURL.b
ind(this, index)), false); | 210 'dblclick', this._edit.bind(this, url, element, this._changeBlockedURL.b
ind(this, index)), false); |
| 210 return element; | 211 return element; |
| 211 } | 212 } |
| 212 | 213 |
| 213 /** | 214 /** |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 * @override | 277 * @override |
| 277 * @param {!UI.Context} context | 278 * @param {!UI.Context} context |
| 278 * @param {string} actionId | 279 * @param {string} actionId |
| 279 * @return {boolean} | 280 * @return {boolean} |
| 280 */ | 281 */ |
| 281 handleAction(context, actionId) { | 282 handleAction(context, actionId) { |
| 282 UI.viewManager.showView('network.blocked-urls'); | 283 UI.viewManager.showView('network.blocked-urls'); |
| 283 return true; | 284 return true; |
| 284 } | 285 } |
| 285 }; | 286 }; |
| OLD | NEW |