[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / resources / chromeos / braille_ime / PRESUBMIT.py
blob2a6d3ab2c8e74989708fd4d6f99c2e8c377485e1
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 """Presubmit script for the Braille IME."""
7 def CheckChangeOnUpload(input_api, output_api):
8 def FileFilter(path):
9 return path.endswith('.js') or path.endswith('check_braille_ime.py')
10 if not any((FileFilter(p) for p in input_api.LocalPaths())):
11 return []
12 import sys
13 if not sys.platform.startswith('linux'):
14 return []
15 sys.path.insert(0, input_api.PresubmitLocalPath())
16 try:
17 from check_braille_ime import check_braille_ime
18 finally:
19 sys.path.pop(0)
20 success, output = check_braille_ime()
21 if not success:
22 return [output_api.PresubmitError(
23 'Braille IME closure compilation failed',
24 long_text=output)]
25 return []