Chromium Code Reviews| 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..706a70374a096b259ab5c5bac77557e885db7d55 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. |
|
Dan Beam
2017/02/17 02:45:17
please wrap comments at 80 cols
xiaoyinh(OOO Sep 11-29)
2017/02/17 19:33:46
Done.
|
| + * @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 () { |
|
Dan Beam
2017/02/17 02:45:17
this is not properly formatted, please run git cl
xiaoyinh(OOO Sep 11-29)
2017/02/17 19:33:46
Done.
|
| + if (document.readyState == "complete") { |
| + // Setting a timeout here to avoid racing with some browsertests, |
|
Dan Beam
2017/02/17 02:45:17
i don't think this guarantees anything about racin
xiaoyinh(OOO Sep 11-29)
2017/02/17 19:33:46
Thanks, I think the failed browsertests are runnin
|
| + // this should be here for only a short period of time as |
| + // md-settings are launching soon. |
| + setTimeout(this.ensurePolymerIsLoaded_.bind(this), |
| + POLYMER_LOAD_TIMEOUT_MS); |
| + } |
| + }.bind(this); |
|
Dan Beam
2017/02/17 02:45:17
can you just do
window.addEventListener('load', f
xiaoyinh(OOO Sep 11-29)
2017/02/17 19:33:46
Done.
|
| }, |
| /** @override */ |
| @@ -67,7 +85,7 @@ cr.define('options', function() { |
| var checkbox = |
| lockScreen.root.querySelector( |
| - 'div.settings-box.single-column.screen-lock'); |
| + 'div.settings-box'); |
|
Dan Beam
2017/02/17 02:45:17
please reformat this with git cl format --js
xiaoyinh(OOO Sep 11-29)
2017/02/17 19:33:46
Done.
|
| checkbox.hidden = true; |
| var passwordPrompt = lockScreen.root. |