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

Unified Diff: chrome/browser/resources/chromeos/login/lock.js

Issue 2015413002: Enable the PIN keyboard on the lockscreen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Address comments 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/login/lock.js
diff --git a/chrome/browser/resources/chromeos/login/lock.js b/chrome/browser/resources/chromeos/login/lock.js
index c1147ef2121f47d0d16ee7cb063a2b1722b1f506..adb71c49a8b62117f92fff7a43b238a6792fcb22 100644
--- a/chrome/browser/resources/chromeos/login/lock.js
+++ b/chrome/browser/resources/chromeos/login/lock.js
@@ -8,10 +8,16 @@
<include src="login_shared.js">
-// Lazy load polymer.
-(function() {
+// Asynchronously loads the pin keyboard.
+function showPinKeyboardAsync() {
'use strict';
+ // This function could get called multiple times. Do nothing if we have
+ // already loaded. This check needs to happen before the registerAssets call,
+ // because that will clobber the loaded state.
+ if (cr.ui.login.ResourceLoader.alreadyLoadedAssets('custom-elements'))
+ return;
+
// Register loader for custom elements.
cr.ui.login.ResourceLoader.registerAssets({
id: 'custom-elements',
@@ -29,13 +35,11 @@
// Loading the PIN element blocks the DOM, which will interrupt any running
// animations. We load the PIN after an idle notification to allow the pod
// fly-in animation to complete without interruption.
- if (loadTimeData.getBoolean('showPin')) {
- cr.ui.login.ResourceLoader.loadAssetsOnIdle('custom-elements', function() {
- cr.ui.login.ResourceLoader.waitUntilLayoutComplete('pin-container',
- onPinLoaded);
- });
- }
-})();
+ cr.ui.login.ResourceLoader.loadAssetsOnIdle('custom-elements', function() {
+ cr.ui.login.ResourceLoader.waitUntilLayoutComplete('pin-container',
+ onPinLoaded);
+ });
+}
cr.define('cr.ui.Oobe', function() {
return {
« no previous file with comments | « chrome/browser/chromeos/login/session/user_session_manager.cc ('k') | chrome/browser/ui/webui/chromeos/login/oobe_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698