Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1356)

Unified Diff: tools/grit/grit/gather/chrome_html.py

Issue 2014793002: [Grit] Allow preprocess-only "inlining" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review fixes. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/grit/grit/format/html_inline.py ('k') | tools/grit/grit/node/include.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/grit/grit/gather/chrome_html.py
diff --git a/tools/grit/grit/gather/chrome_html.py b/tools/grit/grit/gather/chrome_html.py
index e7469bfd5d8eee766c5cb93dc31d45dd04f7ad7d..a8f8eb8ddbf8943af4c061ffb96b56eab246baaf 100755
--- a/tools/grit/grit/gather/chrome_html.py
+++ b/tools/grit/grit/gather/chrome_html.py
@@ -286,6 +286,7 @@ class ChromeHtml(interface.GathererBase):
super(ChromeHtml, self).__init__(*args, **kwargs)
self.allow_external_script_ = False
self.flatten_html_ = False
+ self.preprocess_only_ = False
# 1x resources are implicitly already in the source and do not need to be
# added.
self.scale_factors_ = []
@@ -294,8 +295,10 @@ class ChromeHtml(interface.GathererBase):
def SetAttributes(self, attrs):
self.allow_external_script_ = ('allowexternalscript' in attrs and
attrs['allowexternalscript'] == 'true')
- self.flatten_html_ = ('flattenhtml' in attrs and
- attrs['flattenhtml'] == 'true')
+ self.preprocess_only_ = ('preprocess' in attrs and
+ attrs['preprocess'] == 'true')
+ self.flatten_html_ = (self.preprocess_only_ or ('flattenhtml' in attrs and
+ attrs['flattenhtml'] == 'true'))
def SetDefines(self, defines):
if 'scale_factors' in defines:
@@ -346,6 +349,7 @@ class ChromeHtml(interface.GathererBase):
filename,
self.grd_node,
allow_external_script = self.allow_external_script_,
+ preprocess_only = self.preprocess_only_,
rewrite_function=lambda fp, t, d: ProcessImageSets(
fp, t, self.scale_factors_, d,
filename_expansion_function=self.filename_expansion_function),
« no previous file with comments | « tools/grit/grit/format/html_inline.py ('k') | tools/grit/grit/node/include.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698