Index: chrome/browser/PRESUBMIT.py |
diff --git a/chrome/browser/PRESUBMIT.py b/chrome/browser/PRESUBMIT.py |
index a485728b350aa88c98b2728adc8330d729bca405..114b9c8c5152705be6b8bad295102fb0373bc80a 100644 |
--- a/chrome/browser/PRESUBMIT.py |
+++ b/chrome/browser/PRESUBMIT.py |
@@ -20,6 +20,22 @@ def CheckChangeOnUpload(input_api, output_api): |
def CheckChangeOnCommit(input_api, output_api): |
return _CommonChecks(input_api, output_api) |
+# chrome/browser/about_flags_switches_histogram_ids.h |
+def _CreateAboutFlagsSwitchesHistogramIdsChecker(input_api, output_api): |
+ import sys |
+ original_sys_path = sys.path |
+ |
+ try: |
+ sys.path.append(input_api.os_path.join( |
+ input_api.PresubmitLocalPath(), '..', '..', 'tools', |
+ 'about_flags_switches_histogram_ids_checker')) |
+ from about_flags_switches_histogram_ids_checker \ |
+ import AboutFlagsSwitchesHistogramIDsChecker |
+ finally: |
+ sys.path = original_sys_path |
+ |
+ return AboutFlagsSwitchesHistogramIDsChecker(input_api, output_api, |
+ path='chrome/browser/about_flags_switches_histogram_ids.h') |
def _CommonChecks(input_api, output_api): |
"""Checks common to both upload and commit.""" |
@@ -66,4 +82,10 @@ def _CommonChecks(input_api, output_api): |
finally: |
sys.path = old_path |
+ affected_files = (f.AbsoluteLocalPath() for f in input_api.AffectedFiles()) |
+ if path.join(cwd, 'about_flags_switches_histogram_ids.h') in affected_files : |
+ input_api.logging.info("Running AboutFlagsSwitchesHistogramIdsChecker.") |
+ results += _CreateAboutFlagsSwitchesHistogramIdsChecker(input_api, |
+ output_api).Run() |
+ |
return results |