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

Side by Side Diff: chrome/browser/resources/md_history/app.js

Issue 2520763002: MD History: Preload bold Roboto font (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/md_history/app.crisper.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('md_history', function() { 5 cr.define('md_history', function() {
6 var lazyLoadPromise = null; 6 var lazyLoadPromise = null;
7 function ensureLazyLoaded() { 7 function ensureLazyLoaded() {
8 if (!lazyLoadPromise) { 8 if (!lazyLoadPromise) {
9 lazyLoadPromise = new Promise(function(resolve, reject) { 9 lazyLoadPromise = new Promise(function(resolve, reject) {
10 Polymer.Base.importHref( 10 Polymer.Base.importHref(
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 // Focus the search field on load. Done here to ensure the history page 141 // Focus the search field on load. Done here to ensure the history page
142 // is rendered before we try to take focus. 142 // is rendered before we try to take focus.
143 var searchField = 143 var searchField =
144 /** @type {HistoryToolbarElement} */ (this.$.toolbar).searchField; 144 /** @type {HistoryToolbarElement} */ (this.$.toolbar).searchField;
145 if (!searchField.narrow) { 145 if (!searchField.narrow) {
146 searchField.getSearchInput().focus(); 146 searchField.getSearchInput().focus();
147 } 147 }
148 148
149 // Lazily load the remainder of the UI. 149 // Lazily load the remainder of the UI.
150 md_history.ensureLazyLoaded(); 150 md_history.ensureLazyLoaded().then(function() {
151 window.requestIdleCallback(function() {
152 document.fonts.load('bold 12px Roboto');
153 });
154 });
151 }, 155 },
152 156
153 /** Overridden from IronScrollTargetBehavior */ 157 /** Overridden from IronScrollTargetBehavior */
154 _scrollHandler: function() { 158 _scrollHandler: function() {
155 if (this.scrollTarget) 159 if (this.scrollTarget)
156 this.toolbarShadow_ = this.scrollTarget.scrollTop != 0; 160 this.toolbarShadow_ = this.scrollTarget.scrollTop != 0;
157 }, 161 },
158 162
159 /** @private */ 163 /** @private */
160 onCrToolbarMenuPromoClose_: function() { 164 onCrToolbarMenuPromoClose_: function() {
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 break; 395 break;
392 } 396 }
393 break; 397 break;
394 } 398 }
395 399
396 md_history.BrowserService.getInstance().recordHistogram( 400 md_history.BrowserService.getInstance().recordHistogram(
397 'History.HistoryPageView', histogramValue, HistoryPageViewHistogram.END 401 'History.HistoryPageView', histogramValue, HistoryPageViewHistogram.END
398 ); 402 );
399 }, 403 },
400 }); 404 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/md_history/app.crisper.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698