Discourage new use of CallJavascriptFunctionUnsafe() via PRESUBMIT

[email protected]
BUG=717296

Review-Url: https://codereview.chromium.org/2940893003
Cr-Commit-Position: refs/heads/master@{#479596}
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 55131cdd..6d09321 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -368,6 +368,20 @@
       False,
       (),
     ),
+    (
+      'CallJavascriptFunctionUnsafe',
+      (
+        "Don't use CallJavascriptFunctionUnsafe() in new code. Instead, use",
+        'AllowJavascript(), OnJavascriptAllowed()/OnJavascriptDisallowed(),',
+        'and CallJavascriptFunction(). See https://goo.gl/qivavq.',
+      ),
+      False,
+      (
+        r'^content[\\\/]browser[\\\/]webui[\\\/]web_ui_impl\.(cc|h)$',
+        r'^content[\\\/]public[\\\/]browser[\\\/]web_ui\.h$',
+        r'^content[\\\/]public[\\\/]test[\\\/]test_web_ui\.(cc|h)$',
+      ),
+    ),
 )