[Messages] Add presubmit warning for adding new Android InfoBars

Add presubmit warnings for adding new Android InfoBars
1. Check whether a new id is appended in infobar_delegate.h
2. Check whether new files are created under android infobar
   related folders

Bug: 1233156
Change-Id: I0e9b0800cb806196e4432b0fbd5439c1d0dd937d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3328682
Reviewed-by: Theresa Sullivan <[email protected]>
Reviewed-by: Aishwarya Rajesh <[email protected]>
Reviewed-by: Peter Wen <[email protected]>
Reviewed-by: Evan Stade <[email protected]>
Commit-Queue: Lijin Shen <[email protected]>
Cr-Commit-Position: refs/heads/main@{#952415}
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 6389196..430de79 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -3467,6 +3467,22 @@
   else:
     return checkxmlstyle.CheckStyleOnCommit(input_api, output_api)
 
+def _CheckAndroidInfoBarDeprecation(input_api, output_api):
+  """Checks Android Infobar Deprecation """
+
+  import sys
+  original_sys_path = sys.path
+  try:
+    sys.path = sys.path + [input_api.os_path.join(
+        input_api.PresubmitLocalPath(), 'tools', 'android',
+        'infobar_deprecation')]
+    import infobar_deprecation
+  finally:
+    # Restore sys.path to what it was before.
+    sys.path = original_sys_path
+
+  return infobar_deprecation.CheckDeprecationOnUpload(input_api, output_api)
+
 
 class PydepsChecker(object):
   def __init__(self, input_api, pydeps_files):
@@ -4166,6 +4182,7 @@
   results.extend(_CheckAndroidXmlStyle(input_api, output_api, True))
   results.extend(_CheckNewImagesWarning(input_api, output_api))
   results.extend(_CheckAndroidNoBannedImports(input_api, output_api))
+  results.extend(_CheckAndroidInfoBarDeprecation(input_api, output_api))
   return results
 
 def ChecksAndroidSpecificOnCommit(input_api, output_api):