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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/network/BlockedURLsPane.js

Issue 2807293004: [DevTools] Do not disable blocked URLs list when it's empty (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | 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 (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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 168
169 _removeAll() { 169 _removeAll() {
170 this._manager.setBlockedPatterns([]); 170 this._manager.setBlockedPatterns([]);
171 } 171 }
172 172
173 /** 173 /**
174 * @return {!Promise<?>} 174 * @return {!Promise<?>}
175 */ 175 */
176 _update() { 176 _update() {
177 var enabled = this._manager.blockingEnabled(); 177 var enabled = this._manager.blockingEnabled();
178 this._list.element.classList.toggle('blocking-disabled', !enabled); 178 this._list.element.classList.toggle('blocking-disabled', !enabled && !!this. _manager.blockedPatterns().length);
179 this._enabledCheckbox.setChecked(enabled); 179 this._enabledCheckbox.setChecked(enabled);
180 this._list.clear(); 180 this._list.clear();
181 for (var pattern of this._manager.blockedPatterns()) 181 for (var pattern of this._manager.blockedPatterns())
182 this._list.appendItem(pattern, true); 182 this._list.appendItem(pattern, true);
183 return Promise.resolve(); 183 return Promise.resolve();
184 } 184 }
185 185
186 /** 186 /**
187 * @param {string} url 187 * @param {string} url
188 * @return {number} 188 * @return {number}
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
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;
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698