OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Handling of the <include> element. | 6 """Handling of the <include> element. |
7 """ | 7 """ |
8 | 8 |
9 import os | 9 import os |
10 | 10 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 self._last_flat_filename = flat_filename | 106 self._last_flat_filename = flat_filename |
107 return os.path.basename(flat_filename) | 107 return os.path.basename(flat_filename) |
108 | 108 |
109 def GetHtmlResourceFilenames(self): | 109 def GetHtmlResourceFilenames(self): |
110 """Returns a set of all filenames inlined by this file.""" | 110 """Returns a set of all filenames inlined by this file.""" |
111 allow_external_script = self.attrs['allowexternalscript'] == 'true' | 111 allow_external_script = self.attrs['allowexternalscript'] == 'true' |
112 return grit.format.html_inline.GetResourceFilenames( | 112 return grit.format.html_inline.GetResourceFilenames( |
113 self.ToRealPath(self.GetInputPath()), | 113 self.ToRealPath(self.GetInputPath()), |
114 allow_external_script=allow_external_script) | 114 allow_external_script=allow_external_script) |
115 | 115 |
| 116 def IsResourceMapSource(self): |
| 117 return True |
| 118 |
| 119 def GeneratesResourceMapEntry(self, output_all_resource_defines, |
| 120 is_active_descendant): |
| 121 # includes always generate resource entries. |
| 122 return True |
| 123 |
116 @staticmethod | 124 @staticmethod |
117 def Construct(parent, name, type, file, translateable=True, | 125 def Construct(parent, name, type, file, translateable=True, |
118 filenameonly=False, mkoutput=False, relativepath=False): | 126 filenameonly=False, mkoutput=False, relativepath=False): |
119 """Creates a new node which is a child of 'parent', with attributes set | 127 """Creates a new node which is a child of 'parent', with attributes set |
120 by parameters of the same name. | 128 by parameters of the same name. |
121 """ | 129 """ |
122 # Convert types to appropriate strings | 130 # Convert types to appropriate strings |
123 translateable = util.BoolToString(translateable) | 131 translateable = util.BoolToString(translateable) |
124 filenameonly = util.BoolToString(filenameonly) | 132 filenameonly = util.BoolToString(filenameonly) |
125 mkoutput = util.BoolToString(mkoutput) | 133 mkoutput = util.BoolToString(mkoutput) |
126 relativepath = util.BoolToString(relativepath) | 134 relativepath = util.BoolToString(relativepath) |
127 | 135 |
128 node = IncludeNode() | 136 node = IncludeNode() |
129 node.StartParsing('include', parent) | 137 node.StartParsing('include', parent) |
130 node.HandleAttribute('name', name) | 138 node.HandleAttribute('name', name) |
131 node.HandleAttribute('type', type) | 139 node.HandleAttribute('type', type) |
132 node.HandleAttribute('file', file) | 140 node.HandleAttribute('file', file) |
133 node.HandleAttribute('translateable', translateable) | 141 node.HandleAttribute('translateable', translateable) |
134 node.HandleAttribute('filenameonly', filenameonly) | 142 node.HandleAttribute('filenameonly', filenameonly) |
135 node.HandleAttribute('mkoutput', mkoutput) | 143 node.HandleAttribute('mkoutput', mkoutput) |
136 node.HandleAttribute('relativepath', relativepath) | 144 node.HandleAttribute('relativepath', relativepath) |
137 node.EndParsing() | 145 node.EndParsing() |
138 return node | 146 return node |
OLD | NEW |