Commit 3079ba7d authored by Alexander Alekseev's avatar Alexander Alekseev Committed by Commit Bot

Chrome OS OOBE: do not animate hidden paper-progress element.

Paper-progress in 'indeterminate' state will recalculate its style on every
frame, which leads to high CPU load even when ths screen with this element
is hidden.

This CL ensures this attribute is set only before object is shown, and
paper-progress is marked hidden when it is no longer visible.

Bug: 866117
Change-Id: Ia64171b3e10df2bc564f03f9c3c007a2971cee26
Reviewed-on: https://chromium-review.googlesource.com/1188500Reviewed-by: default avatarJacob Dufault <jdufault@chromium.org>
Commit-Queue: Alexander Alekseev <alemate@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586437}
parent 17863847
...@@ -34,7 +34,8 @@ ...@@ -34,7 +34,8 @@
i18n-content="cancelUpdateHint" hidden="[[!cancelAllowed]]"> i18n-content="cancelUpdateHint" hidden="[[!cancelAllowed]]">
</div> </div>
<div slot="footer" class="flex layout vertical"> <div slot="footer" class="flex layout vertical">
<paper-progress id="checking-progress" indeterminate></paper-progress> <paper-progress id="checking-progress" hidden="[[!checkingForUpdate]]">
</paper-progress>
<div class="flex"></div> <div class="flex"></div>
<img class="update-illustration" <img class="update-illustration"
srcset="images/1x/updating_1x.png 1x, srcset="images/1x/updating_1x.png 1x,
......
...@@ -74,6 +74,18 @@ Polymer({ ...@@ -74,6 +74,18 @@ Polymer({
}, },
}, },
onBeforeShow: function() {
this.behaviors.forEach((behavior) => {
if (behavior.onBeforeShow)
behavior.onBeforeShow.call(this);
});
// 'indeterminate' paper-progress will recalculate styles on every frame
// wnen OOBE is loaded (even when another screen is open).
// So we make it 'indeterminate' only right before screen is shown, and
// make it hidden when its container dialog is hidden.
this.$['checking-progress'].indeterminate = true;
},
/** /**
* This updates "Cancel Update" message. * This updates "Cancel Update" message.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment