Add license header PRESUBMIT check for .icon files.

These files need to have license headers just as C++ files do.

This also adds .icon to the list of known text files which
are checked for Windows line endings.

Bug: 1209079

Change-Id: I33d97afb7efdcb998a390b259d9f5eb5fe3f96ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2895086
Reviewed-by: Scott Violet <[email protected]>
Commit-Queue: Evan Stade <[email protected]>
Cr-Commit-Position: refs/heads/master@{#883171}
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 032995cb..5fc394bd 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -4663,7 +4663,7 @@
   """Check source code and known ascii text files for Windows style line
   endings.
   """
-  known_text_files = r'.*\.(txt|html|htm|mhtml|py|gyp|gypi|gn|isolate)$'
+  known_text_files = r'.*\.(txt|html|htm|mhtml|py|gyp|gypi|gn|isolate|icon)$'
 
   file_inclusion_pattern = (
     known_text_files,
@@ -4688,6 +4688,16 @@
 
   return []
 
+def CheckIconsFilesForLicenseHeaders(input_api, output_api):
+  """Check that .icon files (which are fragments of C++) have license headers.
+  """
+
+  icon_files = r'.*\.icon$'
+
+  icons = lambda x: input_api.FilterSourceFile(x, files_to_check=icon_files)
+  return input_api.canned_checks.CheckLicense(
+      input_api, output_api, source_file_filter=icons)
+
 def CheckForUseOfChromeAppsDeprecations(input_api, output_api):
   """Check source code for use of Chrome App technologies being
   deprecated.