DevTools: Provide error message for Devices Settings Pane (ListWidget)

This change provides the infrastructure to give the user an error
message whenever they enter invalid input into one of the fields of the
ListWidget.Editor.

It also provides the specific error message for the Devices Settings
pane.

Screenshot of error message dialogue: https://imgur.com/a/wD4akTa

This work was originally part of https://chromium-review.googlesource.com/c/chromium/src/+/1562830


Bug: 963183
Change-Id: Ie984366f5f85880cacaaeaea69f5187c5313ac6d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1629757
Commit-Queue: Amanda Baker <[email protected]>
Reviewed-by: Joel Einbinder <[email protected]>
Cr-Original-Commit-Position: refs/heads/master@{#673884}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c346cec0ac5cf9dd2c32acdc44a16d241a9375dd
diff --git a/front_end/network/BlockedURLsPane.js b/front_end/network/BlockedURLsPane.js
index 3991d91..2ec93c9 100644
--- a/front_end/network/BlockedURLsPane.js
+++ b/front_end/network/BlockedURLsPane.js
@@ -154,10 +154,11 @@
     titles.createChild('div').textContent =
         Common.UIString('Text pattern to block matching requests; use * for wildcard');
     const fields = content.createChild('div', 'blocked-url-edit-row');
-    const urlInput = editor.createInput(
-        'url', 'text', '',
-        (item, index, input) =>
-            !!input.value && !this._manager.blockedPatterns().find(pattern => pattern.url === input.value));
+    const validator = (item, index, input) => {
+      const valid = !!input.value && !this._manager.blockedPatterns().find(pattern => pattern.url === input.value);
+      return {valid};
+    };
+    const urlInput = editor.createInput('url', 'text', '', validator);
     fields.createChild('div', 'blocked-url-edit-value').appendChild(urlInput);
     return editor;
   }