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

Unified Diff: chrome/browser/resources/md_history/app.js

Issue 2264983002: MD History: Lazily load element files which are not needed for first paint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove flattenhtml, rebase 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
« no previous file with comments | « chrome/browser/resources/md_history/app.html ('k') | chrome/browser/resources/md_history/app.crisper.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_history/app.js
diff --git a/chrome/browser/resources/md_history/app.js b/chrome/browser/resources/md_history/app.js
index 5e0d1b88084415a9ebc40424f899fb12aef7290e..e3ce661c53ff300564fe432bff9707cf650ba461 100644
--- a/chrome/browser/resources/md_history/app.js
+++ b/chrome/browser/resources/md_history/app.js
@@ -2,6 +2,23 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+cr.define('md_history', function() {
+ var lazyLoadPromise = null;
+ function ensureLazyLoaded() {
+ if (!lazyLoadPromise) {
+ lazyLoadPromise = new Promise(function(resolve, reject) {
+ Polymer.Base.importHref(
+ 'chrome://history/lazy_load.html', resolve, reject, true);
+ });
+ }
+ return lazyLoadPromise;
+ }
+
+ return {
+ ensureLazyLoaded: ensureLazyLoaded,
+ };
+});
+
Polymer({
is: 'history-app',
@@ -124,6 +141,9 @@ Polymer({
if (!this.hasDrawer_) {
this.focusToolbarSearchField();
}
+
+ // Lazily load the remainder of the UI.
+ md_history.ensureLazyLoaded();
},
/** Overridden from IronScrollTargetBehavior */
« no previous file with comments | « chrome/browser/resources/md_history/app.html ('k') | chrome/browser/resources/md_history/app.crisper.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698