Merge change 26273 into eclair

* changes:
  Updates for bookmarks page.
diff --git a/res/layout/custom_screen.xml b/res/layout/custom_screen.xml
index d1f1658..8bc03fb 100644
--- a/res/layout/custom_screen.xml
+++ b/res/layout/custom_screen.xml
@@ -33,7 +33,6 @@
         <FrameLayout android:id="@+id/main_content"
             android:layout_width="fill_parent"
             android:layout_height="fill_parent"
-            android:foreground="?android:attr/windowContentOverlay"
         />
     </LinearLayout>
 </FrameLayout>
diff --git a/res/layout/title_bar_bg.xml b/res/layout/title_bar_bg.xml
index c4213b0..4b52ce1 100644
--- a/res/layout/title_bar_bg.xml
+++ b/res/layout/title_bar_bg.xml
@@ -15,9 +15,14 @@
    limitations under the License.
 -->
 
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_height="wrap_content"
     android:layout_width="wrap_content"
-    android:foreground="?android:attr/windowContentOverlay"
-    android:background="@color/white"
-    />
+    android:orientation="vertical"
+    >
+        <View
+            android:layout_height="5dip"
+            android:layout_width="fill_parent"
+            android:background="@*android:drawable/title_bar_shadow"
+            />
+</LinearLayout>
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index dc85ec0..b93c554 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -950,8 +950,10 @@
     }
 
     private void showFakeTitleBar() {
+        final View decor = getWindow().peekDecorView();
         if (mFakeTitleBar == null && mActiveTabsPage == null
-                && !mActivityInPause) {
+                && !mActivityInPause && decor != null
+                && decor.getWindowToken() != null) {
             final WebView webView = getTopWindow();
             mFakeTitleBar = new TitleBar(this);
             mFakeTitleBar.setTitleAndUrl(null, webView.getUrl());
@@ -970,27 +972,25 @@
                     ViewGroup.LayoutParams.WRAP_CONTENT,
                     WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL,
                     WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
-                    PixelFormat.OPAQUE);
+                    PixelFormat.TRANSLUCENT);
             params.gravity = Gravity.TOP;
             WebView mainView = mTabControl.getCurrentWebView();
-            params.windowAnimations = mainView == null
-                    || mainView.getScrollY() != 0
-                    ? com.android.internal.R.style.Animation_DropDownDown : 0;
+            boolean atTop = mainView != null && mainView.getScrollY() == 0;
+            params.windowAnimations = atTop ? 0
+                    : com.android.internal.R.style.Animation_DropDownDown;
             // XXX : Without providing an offset, the fake title bar will be
             // placed underneath the status bar.  Use the global visible rect
             // of mBrowserFrameLayout to determine the bottom of the status bar
             Rect rectangle = new Rect();
             mBrowserFrameLayout.getGlobalVisibleRect(rectangle);
             params.y = rectangle.top;
-            // Add a holder for the title bar.  It is a FrameLayout, which
-            // allows it to have an overlay shadow.  It also has a white
-            // background, which is the same as the background when it is
-            // placed in a WebView.
+            // Add a holder for the title bar.  It also holds a shadow to show
+            // below the title bar.
             if (mFakeTitleBarHolder == null) {
                 mFakeTitleBarHolder = (ViewGroup) LayoutInflater.from(this)
                     .inflate(R.layout.title_bar_bg, null);
             }
-            mFakeTitleBarHolder.addView(mFakeTitleBar, mFakeTitleBarParams);
+            mFakeTitleBarHolder.addView(mFakeTitleBar, 0, mFakeTitleBarParams);
             manager.addView(mFakeTitleBarHolder, params);
         }
     }