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

Unified Diff: chrome/browser/resources/md_downloads/downloads.js

Issue 2361973002: MD Downloads: preload bold Roboto in a better way (Closed)
Patch Set: !chromeos Created 4 years, 3 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
Index: chrome/browser/resources/md_downloads/downloads.js
diff --git a/chrome/browser/resources/md_downloads/downloads.js b/chrome/browser/resources/md_downloads/downloads.js
index 5cbff3122d314af269d96f286a693229765f9c0e..8ea3fde8ec4ac7c62c14aa554d3b57c9d6f699a7 100644
--- a/chrome/browser/resources/md_downloads/downloads.js
+++ b/chrome/browser/resources/md_downloads/downloads.js
@@ -2,4 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-window.addEventListener('load', downloads.Manager.onLoad);
+window.addEventListener('load', function() {
+ downloads.Manager.onLoad();
+
+ if (!cr.isChromeOS) {
+ // TODO(dbeam): this is copied out of roboto.css. I excluded roboto.css from
+ // vulcanize.py and tried to re-use the "src:" rule from the file via
+ // querySelector(href$=roboto.css).sheet.rules[2].style.src, but alas .rules
+ // can't be accessed because the origins don't match (chrome://resources vs
+ // chrome://downloads). So it's duplicated.
+ new FontFace('Roboto', "local('Roboto Bold'), local('Roboto-Bold'), " +
+ "url(chrome://resources/roboto/roboto-bold.woff2) format('woff2')",
+ {weight: 'bold'}).load();
+ }
+});
« no previous file with comments | « chrome/browser/resources/md_downloads/downloads.html ('k') | chrome/browser/resources/md_downloads/vulcanized.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698