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

Side by Side Diff: ui/login/account_picker/user_pod_template.js

Issue 2007133006: Use svg icon to avoid lazy loading of Polymer elements for user pods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update tests with regard to the latest changes while tests were disabled Created 4 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 unified diff | Download patch
« no previous file with comments | « ui/login/account_picker/user_pod_template.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 (function() {
6 "use strict";
7
8 var RESOURCES_TO_LOAD = [
9 'chrome://resources/polymer/v1_0/iron-icons/iron-icons.html',
10 'chrome://resources/polymer/v1_0/paper-button/paper-button.html'
11 ];
12 /* const */ var IDLE_TIMEOUT_MS = 200;
13
14 window.addEventListener('load', function() {
15 // The user pod template gets cloned shortly after the load event to make
16 // the actual user pods. It then takes a few update cycles to style these
17 // elements. Loading polymer will block the DOM, so we try to load polymer
18 // after the user pods have been cloned and styled.
19 requestIdleCallback(function() {
20 for (var resourceUrl of RESOURCES_TO_LOAD) {
21 var link = document.createElement('link');
22 link.rel = 'import';
23 link.href = resourceUrl;
24 document.head.appendChild(link);
25 }
26 }, { timeout: IDLE_TIMEOUT_MS });
27 });
28 })();
OLDNEW
« no previous file with comments | « ui/login/account_picker/user_pod_template.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698