Recalculate layer transparent regions when TitleBar is hidden/shown

Recalculating the transparent region when the
TitleBar is hidden removes the Browser UI layer from
SurfaceFlinger.

Also fixes the blank title bar issue in scrolling and
full screen video playback cases.

Change-Id: I5e9335c2f84891da8558d1943e80c0312952abd0
diff --git a/src/com/android/browser/BaseUi.java b/src/com/android/browser/BaseUi.java
index 92c5d46..64e7416 100644
--- a/src/com/android/browser/BaseUi.java
+++ b/src/com/android/browser/BaseUi.java
@@ -832,7 +832,7 @@
                 getWebView().updateTopControls(true, false, false);
             } else {
                 //show the topbar
-                getWebView().updateTopControls(false, true, true);
+                getWebView().updateTopControls(false, true, false);
                 //enable for auto-hide
                 if (!mTitleBar.isFixed())
                     getWebView().updateTopControls(true, true, false);
@@ -850,6 +850,14 @@
                 mTitleBar.setEnabled(true);
             }
             if (!mTitleBar.isFixed()) {
+                float currentY = mTitleBar.getTranslationY();
+                float height = mTitleBar.getHeight();
+                if ((height + currentY) <= 0 && (height + topControlsOffsetYPix) > 0) {
+                    mTitleBar.requestLayout();
+                } else if ((height + topControlsOffsetYPix) <= 0) {
+                    topControlsOffsetYPix -= 1;
+                    mTitleBar.getParent().requestTransparentRegion(mTitleBar);
+                }
                 mTitleBar.setTranslationY(topControlsOffsetYPix);
             }
         }