Bug 1358805 - part 3: Keep the toolbar state between UI thread and compositor thread consistent once IPC is open r=kats draft
authorRandall Barker <rbarker@mozilla.com>
Tue, 25 Apr 2017 12:50:59 -0700
changeset 568266 cf57c458690aa807a00cb44d7c89921470402c06
parent 568265 056c9605bb04d998f47fd615f4fcfeabbd415e3b
child 568267 ee832013e07d691e77c4aea9f1f9e74ef86e463f
push id55808
push userbmo:rbarker@mozilla.com
push dateTue, 25 Apr 2017 22:12:34 +0000
reviewerskats
bugs1358805
milestone55.0a1
Bug 1358805 - part 3: Keep the toolbar state between UI thread and compositor thread consistent once IPC is open r=kats MozReview-Commit-ID: H7qrShryomi
mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/DynamicToolbarAnimator.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/DynamicToolbarAnimator.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/DynamicToolbarAnimator.java
@@ -149,16 +149,21 @@ public class DynamicToolbarAnimator {
     public PointF getVisibleEndOfLayerView() {
         return new PointF(mTarget.getView().getWidth(),
             mTarget.getView().getHeight());
     }
 
     private void dumpStateToCompositor() {
         if ((mCompositor != null) && mCompositorControllerOpen) {
             mCompositor.setMaxToolbarHeight(mMaxToolbarHeight);
+            if ((mToolbarChromeProxy != null) && mToolbarChromeProxy.isToolbarChromeVisible()) {
+                mCompositor.sendToolbarAnimatorMessage(LayerView.REQUEST_SHOW_TOOLBAR_IMMEDIATELY);
+            } else {
+                mCompositor.sendToolbarAnimatorMessage(LayerView.REQUEST_HIDE_TOOLBAR_IMMEDIATELY);
+            }
             for (PinReason reason : pinFlags) {
               mCompositor.setPinned(true, reason.mValue);
             }
         } else if ((mCompositor != null) && !mCompositorControllerOpen) {
             // Ask the UiCompositorControllerChild if it is open since the open message can
             // sometimes be sent to a different instance of the LayerView such as when
             // Fennec is being used in custom tabs.
             mCompositor.sendToolbarAnimatorMessage(LayerView.IS_COMPOSITOR_CONTROLLER_OPEN);