Add presubmit check to make sure we don't include ui/aura/window_property.h in header files.
BUG=144155
TEST=none
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/11342044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164995 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index a401473d..f0e4231 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -467,11 +467,31 @@
results = []
if errors:
- results.append(output_api.PreSubmitError('checkperms.py failed.',
+ results.append(output_api.PresubmitError('checkperms.py failed.',
errors))
return results
+def _CheckNoAuraWindowPropertyHInHeaders(input_api, output_api):
+ """Makes sure we don't include ui/aura/window_property.h
+ in header files.
+ """
+ pattern = input_api.re.compile(r'^#include\s*"ui/aura/window_property.h"')
+ errors = []
+ for f in input_api.AffectedFiles():
+ if not f.LocalPath().endswith('.h'):
+ continue
+ for line_num, line in f.ChangedContents():
+ if pattern.match(line):
+ errors.append(' %s:%d' % (f.LocalPath(), line_num))
+
+ results = []
+ if errors:
+ results.append(output_api.PresubmitError(
+ 'Header files should not include ui/aura/window_property.h', errors))
+ return results
+
+
def _CommonChecks(input_api, output_api):
"""Checks common to both upload and commit."""
results = []
@@ -489,6 +509,7 @@
results.extend(_CheckNoTrinaryTrueFalse(input_api, output_api))
results.extend(_CheckUnwantedDependencies(input_api, output_api))
results.extend(_CheckFilePermissions(input_api, output_api))
+ results.extend(_CheckNoAuraWindowPropertyHInHeaders(input_api, output_api))
return results