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 b6d067801353192aad15c98251587b1b25b5594b..15efe1057b2d490e92c20fbc264c50815faabd8a 100644 |
--- a/chrome/browser/resources/options/chromeos/quick_unlock_configure_overlay.js |
+++ b/chrome/browser/resources/options/chromeos/quick_unlock_configure_overlay.js |
@@ -7,6 +7,14 @@ cr.define('options', function() { |
var PageManager = cr.ui.pageManager.PageManager; |
/** |
+ * Maximum time to wait after the page is fully loaded before |
+ * we start to load polymer elements. |
+ * @type {number} |
+ * @const |
+ */ |
+ var POLYMER_LOAD_TIMEOUT_MS = 5000; |
+ |
+ /** |
* QuickUnlockConfigureOverlay class |
* Dialog that allows users to configure screen lock. |
* @constructor |
@@ -30,6 +38,16 @@ cr.define('options', function() { |
$('screen-lock-done').onclick = function() { |
QuickUnlockConfigureOverlay.dismiss(); |
}; |
+ |
+ document.onreadystatechange = function () { |
+ if (document.readyState == "complete") { |
+ // Setting a timeout here to avoid racing with some browsertests, |
+ // this should be here for only a short period of time as |
+ // md-settings are lanuching soon. |
jdufault
2017/02/15 23:53:22
nit: are lanuching -> is launching
xiaoyinh(OOO Sep 11-29)
2017/02/17 01:31:44
Done.
|
+ setTimeout(this.ensurePolymerIsLoaded_.bind(this), |
+ POLYMER_LOAD_TIMEOUT_MS); |
+ } |
+ }.bind(this); |
}, |
/** @override */ |
@@ -67,7 +85,7 @@ cr.define('options', function() { |
var checkbox = |
lockScreen.root.querySelector( |
- 'div.settings-box.single-column.screen-lock'); |
+ 'div.settings-box'); |
checkbox.hidden = true; |
var passwordPrompt = lockScreen.root. |