Chromium Code Reviews| 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 * @implements {UI.ListWidget.Delegate} | 5 * @implements {UI.ListWidget.Delegate} |
| 6 * @unrestricted | 6 * @unrestricted |
| 7 */ | 7 */ |
| 8 Network.BlockedURLsPane = class extends UI.VBox { | 8 Network.BlockedURLsPane = class extends UI.VBox { |
| 9 constructor() { | 9 constructor() { |
| 10 super(true); | 10 super(true); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 146 /** | 146 /** |
| 147 * @return {!UI.ListWidget.Editor} | 147 * @return {!UI.ListWidget.Editor} |
| 148 */ | 148 */ |
| 149 _createEditor() { | 149 _createEditor() { |
| 150 if (this._editor) | 150 if (this._editor) |
| 151 return this._editor; | 151 return this._editor; |
| 152 | 152 |
| 153 var editor = new UI.ListWidget.Editor(); | 153 var editor = new UI.ListWidget.Editor(); |
| 154 var content = editor.contentElement(); | 154 var content = editor.contentElement(); |
| 155 var titles = content.createChild('div', 'blocked-url-edit-row'); | 155 var titles = content.createChild('div', 'blocked-url-edit-row'); |
| 156 titles.createChild('div', 'blocked-url-edit-value').textContent = | 156 titles.createChild('div').textContent = |
|
luoe
2017/05/26 23:41:04
This element is help text that is constantly visib
| |
| 157 Common.UIString('Text pattern to block matching requests; use * for wild card'); | 157 Common.UIString('Text pattern to block matching requests; use * for wild card'); |
| 158 var fields = content.createChild('div', 'blocked-url-edit-row'); | 158 var fields = content.createChild('div', 'blocked-url-edit-row'); |
| 159 var urlInput = editor.createInput( | 159 var urlInput = editor.createInput( |
| 160 'url', 'text', '', | 160 'url', 'text', '', |
| 161 (item, index, input) => | 161 (item, index, input) => |
| 162 !!input.value && !this._manager.blockedPatterns().find(pattern => pa ttern.url === input.value)); | 162 !!input.value && !this._manager.blockedPatterns().find(pattern => pa ttern.url === input.value)); |
| 163 fields.createChild('div', 'blocked-url-edit-value').appendChild(urlInput); | 163 fields.createChild('div', 'blocked-url-edit-value').appendChild(urlInput); |
| 164 | 164 |
| 165 this._editor = editor; | 165 this._editor = editor; |
| 166 return editor; | 166 return editor; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 232 if (request.wasBlocked()) { | 232 if (request.wasBlocked()) { |
| 233 var count = this._blockedCountForUrl.get(request.url()) || 0; | 233 var count = this._blockedCountForUrl.get(request.url()) || 0; |
| 234 this._blockedCountForUrl.set(request.url(), count + 1); | 234 this._blockedCountForUrl.set(request.url(), count + 1); |
| 235 this._updateThrottler.schedule(this._update.bind(this)); | 235 this._updateThrottler.schedule(this._update.bind(this)); |
| 236 } | 236 } |
| 237 } | 237 } |
| 238 }; | 238 }; |
| 239 | 239 |
| 240 /** @type {?Network.BlockedURLsPane} */ | 240 /** @type {?Network.BlockedURLsPane} */ |
| 241 Network.BlockedURLsPane._instance = null; | 241 Network.BlockedURLsPane._instance = null; |
| OLD | NEW |