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

Unified Diff: chrome/browser/resources/options/chromeos/quick_unlock_configure_overlay.js

Issue 2529293015: Options: lazily load Polymer when quick unlock dialog is triggered (Closed)
Patch Set: asdf Created 4 years 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 | chrome/browser/resources/options/options.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/chromeos/quick_unlock_configure_overlay.js
diff --git a/chrome/browser/resources/options/chromeos/quick_unlock_configure_overlay.js b/chrome/browser/resources/options/chromeos/quick_unlock_configure_overlay.js
index 5996d71dc0ab7c615b08ea648848ac7221899cff..3253bad870509170113d4c820cc3dede9b2e3e06 100644
--- a/chrome/browser/resources/options/chromeos/quick_unlock_configure_overlay.js
+++ b/chrome/browser/resources/options/chromeos/quick_unlock_configure_overlay.js
@@ -39,6 +39,29 @@ cr.define('options', function() {
/** @override */
didShowPage: function() {
+ this.ensurePolymerIsLoaded_().then(this.onPolymerLoaded_.bind(this));
+ },
+
+ /**
+ * @return {!Promise}
+ * @private
+ */
+ ensurePolymerIsLoaded_: function() {
+ this.loaded_ = this.loaded_ || new Promise(function(resolve) {
+ var link = document.createElement('link');
+ link.rel = 'import';
+ link.href = 'chrome://settings-frame/options_polymer.html';
+ link.onload = resolve;
+ document.head.appendChild(link);
+ });
+ return this.loaded_;
+ },
+
+ /**
+ * Called when polymer has been loaded and the dialog should be displayed.
+ * @private
+ */
+ onPolymerLoaded_: function() {
settings.navigateTo(settings.Route.LOCK_SCREEN);
var lockScreen = document.querySelector('settings-lock-screen');
@@ -54,7 +77,6 @@ cr.define('options', function() {
}
}.bind(this));
},
-
};
QuickUnlockConfigureOverlay.dismiss = function() {
« no previous file with comments | « no previous file | chrome/browser/resources/options/options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698