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

Unified Diff: grit/gather/chrome_html.py

Issue 15713020: High DPI support for Themes: change chrome_html.py (Closed) Base URL: https://chromium.googlesource.com/external/grit-i18n.git@master
Patch Set: unittest Created 7 years, 6 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 | « no previous file | grit/gather/chrome_html_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: grit/gather/chrome_html.py
diff --git a/grit/gather/chrome_html.py b/grit/gather/chrome_html.py
index d554776fac1aa0ba620173dbae56799104bf54f9..840b2514f5d4e822973ee361b394455feda296d9 100644
--- a/grit/gather/chrome_html.py
+++ b/grit/gather/chrome_html.py
@@ -29,7 +29,8 @@ DIST_SUBSTR = '%DISTRIBUTION%'
# Matches a chrome theme source URL.
-_THEME_SOURCE = lazy_re.compile('chrome://theme/IDR_[A-Z0-9_]*')
+_THEME_SOURCE = lazy_re.compile(
+ '(?P<baseurl>chrome://theme/IDR_[A-Z0-9_]*)(?P<query>\?.*)?')
# Matches CSS image urls with the capture group 'filename'.
_CSS_IMAGE_URLS = lazy_re.compile(
'(?P<attribute>content|background|[\w-]*-image):[ ]*' +
@@ -69,10 +70,14 @@ def GetImageList(
"""
# Any matches for which a chrome URL handler will serve all scale factors
# can simply request all scale factors.
- if _THEME_SOURCE.match(filename):
+ theme_match = _THEME_SOURCE.match(filename)
+ if theme_match:
images = [('1x', filename)]
for scale_factor in scale_factors:
- images.append((scale_factor, "%s@%s" % (filename, scale_factor)))
+ scale_filename = "%s@%s" % (theme_match.group('baseurl'), scale_factor)
+ if theme_match.group('query'):
+ scale_filename += theme_match.group('query')
+ images.append((scale_factor, scale_filename))
return images
if filename.find(':') != -1:
« no previous file with comments | « no previous file | grit/gather/chrome_html_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698