Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / tools / metrics / histograms / update_extension_permission.py
blob85073f98b5297b79f0cd2e25c05fa54bfdc55422
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 """Updates the ExtensionPermission3 enum in the histograms.xml file with values
6 read from api_permission.h.
8 If the file was pretty-printed, the updated version is pretty-printed too.
9 """
11 import os
12 import sys
14 from update_histogram_enum import UpdateHistogramEnum
16 if __name__ == '__main__':
17 if len(sys.argv) > 1:
18 print >>sys.stderr, 'No arguments expected!'
19 sys.stderr.write(__doc__)
20 sys.exit(1)
22 header_file = 'extensions/common/permissions/api_permission.h'
23 UpdateHistogramEnum(histogram_enum_name='ExtensionPermission3',
24 source_enum_path=header_file,
25 start_marker='^enum ID {',
26 end_marker='^kEnumBoundary')