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

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

Issue 2814563004: [DevTools] Handle blocked urls disabled state better in UI (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/network/blockedURLsPane.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/network/BlockedURLsPane.js
diff --git a/third_party/WebKit/Source/devtools/front_end/network/BlockedURLsPane.js b/third_party/WebKit/Source/devtools/front_end/network/BlockedURLsPane.js
index b8c3d2b9e4dae8a5eee79b7a18b05c3c431f3486..70daa6ec5be8c64cde1380dda64886780d1b4268 100644
--- a/third_party/WebKit/Source/devtools/front_end/network/BlockedURLsPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/network/BlockedURLsPane.js
@@ -61,6 +61,7 @@ Network.BlockedURLsPane = class extends UI.VBox {
}
_addButtonClicked() {
+ this._manager.setBlockingEnabled(true);
this._list.addNewItem(0, {url: '', enabled: true});
}
@@ -77,6 +78,7 @@ Network.BlockedURLsPane = class extends UI.VBox {
var checkbox = element.createChild('input', 'blocked-url-checkbox');
checkbox.type = 'checkbox';
checkbox.checked = pattern.enabled;
+ checkbox.disabled = !this._manager.blockingEnabled();
element.createChild('div', 'blocked-url-label').textContent = pattern.url;
element.createChild('div', 'blocked-url-count').textContent = Common.UIString('%d blocked', count);
element.addEventListener('click', event => this._togglePattern(pattern, event), false);
@@ -97,6 +99,7 @@ Network.BlockedURLsPane = class extends UI.VBox {
_toggleEnabled() {
this._manager.setBlockingEnabled(!this._manager.blockingEnabled());
+ this._update();
}
/**
@@ -171,7 +174,9 @@ Network.BlockedURLsPane = class extends UI.VBox {
* @return {!Promise<?>}
*/
_update() {
- this._enabledCheckbox.setChecked(this._manager.blockingEnabled());
+ var enabled = this._manager.blockingEnabled();
+ this._list.element.classList.toggle('blocking-disabled', !enabled);
+ this._enabledCheckbox.setChecked(enabled);
this._list.clear();
for (var pattern of this._manager.blockedPatterns())
this._list.appendItem(pattern, true);
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/network/blockedURLsPane.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698