merge in honeycomb-release history after reset to honeycomb
diff --git a/res/drawable-mdpi/textfield_active_holo_dark.9.png b/res/drawable-mdpi/textfield_active_holo_dark.9.png
index d37c8b2..7ca771f 100644
--- a/res/drawable-mdpi/textfield_active_holo_dark.9.png
+++ b/res/drawable-mdpi/textfield_active_holo_dark.9.png
Binary files differ
diff --git a/res/drawable-mdpi/textfield_default_holo_dark.9.png b/res/drawable-mdpi/textfield_default_holo_dark.9.png
index ab6abdc..621d024 100644
--- a/res/drawable-mdpi/textfield_default_holo_dark.9.png
+++ b/res/drawable-mdpi/textfield_default_holo_dark.9.png
Binary files differ
diff --git a/res/drawable/url_background.xml b/res/drawable/url_background.xml
new file mode 100644
index 0000000..f719c29
--- /dev/null
+++ b/res/drawable/url_background.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector
+    xmlns:android="http://schemas.android.com/apk/res/android">
+    <item
+        android:state_focused="true"
+        android:drawable="@drawable/textfield_active_holo_dark" />
+    <item
+        android:state_focused="false"
+        android:drawable="@drawable/textfield_default_holo_dark" />
+</selector>
\ No newline at end of file
diff --git a/res/layout/tab_title.xml b/res/layout/tab_title.xml
index 0f500c7..e2c6d0a 100644
--- a/res/layout/tab_title.xml
+++ b/res/layout/tab_title.xml
@@ -18,17 +18,15 @@
     android:orientation="horizontal">
     <ImageView
         android:id="@+id/chevron"
-        android:layout_width="16dip"
-        android:layout_height="16dip"
-        android:layout_marginRight="4dip"
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
         android:gravity="center_vertical"
         android:src="@drawable/ic_chevron"
         android:visibility="gone" />
     <ImageView
         android:id="@+id/incognito"
-        android:layout_width="32dip"
-        android:layout_height="32dip"
-        android:layout_marginRight="8dip"
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
         android:gravity="center_vertical"
         android:src="@drawable/ic_incognito_holo_dark"
         android:visibility="gone" />
@@ -36,25 +34,24 @@
         android:id="@+id/favicon"
         android:layout_width="20dip"
         android:layout_height="20dip"
-        android:layout_marginRight="16dip" />
+        android:layout_marginLeft="8dip"
+        android:layout_marginRight="8dip" />
     <ImageView
         android:id="@+id/lock"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginRight="16dip"
         android:visibility="gone" />
     <TextView
         android:id="@+id/title"
         android:layout_height="match_parent"
         android:layout_width="0dip"
         android:layout_weight="1.0"
-        android:layout_marginRight="16dip"
+        android:paddingLeft="8dip"
+        android:paddingRight="8dip"
         android:textAppearance="?android:attr/textAppearanceSmall"
         android:textColor="@color/white"
         android:gravity="center_vertical"
         android:scrollHorizontally="true"
-        android:fadingEdge="horizontal"
-        android:fadingEdgeLength="24dip"
         android:lines="1"
         android:singleLine="true" />
     <ImageButton
@@ -62,6 +59,5 @@
         android:background="?android:attr/selectableItemBackground"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginRight="16dip"
         android:src="@drawable/ic_tab_close" />
 </merge>
diff --git a/res/layout/url_bar.xml b/res/layout/url_bar.xml
index 3a4e4bb..f8eb03b 100644
--- a/res/layout/url_bar.xml
+++ b/res/layout/url_bar.xml
@@ -35,7 +35,7 @@
             android:layout_width="wrap_content"
             android:layout_height="match_parent"
             style="@style/HoloButton" />
-        <ImageView
+        <ImageButton
             android:id="@+id/stop"
             android:layout_width="wrap_content"
             android:layout_height="match_parent"
@@ -50,7 +50,13 @@
             android:layout_marginLeft="8dip"
             android:layout_marginRight="8dip"
             android:orientation="horizontal"
-            android:background="@drawable/textfield_default_holo_dark">
+            android:background="@drawable/url_background">
+            <ImageView
+                android:id="@+id/web_icon"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:src="@drawable/ic_web_holo_dark"
+                style="@style/HoloIcon" />
             <ImageView
                 android:id="@+id/voice_icon"
                 android:layout_width="wrap_content"
@@ -66,6 +72,7 @@
                 android:visibility="gone" />
             <com.android.browser.UrlInputView
                 android:id="@+id/url_focused"
+                android:focusable="true"
                 android:layout_width="0dip"
                 android:layout_weight="1.0"
                 android:layout_height="match_parent"
@@ -83,13 +90,13 @@
                 android:inputType="textUri"
                 android:imeOptions="actionGo"
                 style="@style/Suggestions" />
-            <ImageView
+            <ImageButton
                 android:id="@+id/star"
                 android:src="@drawable/btn_imageview_star"
                 android:layout_width="wrap_content"
                 android:layout_height="match_parent"
                 style="@style/HoloButton" />
-            <ImageView
+            <ImageButton
                 android:id="@+id/clear"
                 android:src="@drawable/ic_stop_holo_dark"
                 android:layout_width="wrap_content"
@@ -104,7 +111,7 @@
             android:visibility="gone"
             android:gravity="center_vertical"
             style="@style/HoloButton" />
-        <ImageView
+        <ImageButton
             android:id="@+id/voicesearch"
             android:src="@drawable/ic_voice_search_holo_dark"
             android:layout_width="wrap_content"
diff --git a/res/menu-xlarge/browser.xml b/res/menu-xlarge/browser.xml
index bd255ae..1b52c9a 100644
--- a/res/menu-xlarge/browser.xml
+++ b/res/menu-xlarge/browser.xml
@@ -39,7 +39,7 @@
         <item android:id="@+id/view_downloads_menu_id"
             android:title="@string/menu_view_download"
             android:icon="@drawable/ic_downloads_holo_dark"
-            android:alphabeticShortcut="d" />
+            android:alphabeticShortcut="j" />
         <item android:id="@+id/preferences_menu_id"
             android:title="@string/menu_preferences"
             android:icon="@drawable/ic_settings_holo_dark"
@@ -77,14 +77,12 @@
             android:alphabeticShortcut="7" />
         <item android:id="@+id/window_eight_menu_id"
             android:alphabeticShortcut="8" />
-        <item android:id="@+id/back_menu_id"
-            android:alphabeticShortcut="j" />
-        <item android:id="@+id/forward_menu_id"
-            android:alphabeticShortcut="k" />
+        <item android:id="@+id/back_menu_id" />
+        <item android:id="@+id/forward_menu_id" />
         <item android:id="@+id/bookmarks_menu_id"
             android:alphabeticShortcut="b" />
         <item android:id="@+id/add_bookmark_menu_id"
-            android:alphabeticShortcut="a" />
+            android:alphabeticShortcut="d" />
         <item android:id="@+id/stop_reload_menu_id"
             android:alphabeticShortcut="r" />
         <item android:id="@+id/goto_menu_id"
diff --git a/res/menu/browser.xml b/res/menu/browser.xml
index 594681a..beaa8f3 100644
--- a/res/menu/browser.xml
+++ b/res/menu/browser.xml
@@ -23,8 +23,7 @@
         <item android:id="@+id/bookmarks_menu_id"
             android:title="@string/bookmarks"
             android:alphabeticShortcut="b"
-            android:icon="@drawable/ic_bookmarks_holo_dark"
-            />
+            android:icon="@drawable/ic_bookmarks_holo_dark" />
         <item android:id="@+id/active_tabs_menu_id"
             android:title="@string/active_tabs"
             android:icon="@drawable/ic_windows_holo_dark"
@@ -33,12 +32,11 @@
             android:alphabeticShortcut="r" />
         <item android:id="@+id/forward_menu_id"
             android:title="@string/forward"
-            android:alphabeticShortcut="k"
             android:icon="@*android:drawable/ic_menu_forward" />
         <item android:id="@+id/add_bookmark_menu_id"
             android:title="@string/save_to_bookmarks"
             android:icon="@drawable/ic_bookmark_on_holo_dark"
-            android:alphabeticShortcut="a" />
+            android:alphabeticShortcut="d" />
         <item android:id="@+id/find_menu_id"
             android:title="@*android:string/find_on_page"
             android:icon="@*android:drawable/ic_menu_find"
@@ -54,7 +52,7 @@
         <item android:id="@+id/view_downloads_menu_id"
             android:title="@string/menu_view_download"
             android:icon="@drawable/ic_downloads_holo_dark"
-            android:alphabeticShortcut="d" />
+            android:alphabeticShortcut="j" />
         <item android:id="@+id/preferences_menu_id"
             android:title="@string/menu_preferences"
             android:icon="@drawable/ic_settings_holo_dark"
@@ -92,8 +90,7 @@
             android:alphabeticShortcut="7" />
         <item android:id="@+id/window_eight_menu_id"
             android:alphabeticShortcut="8" />
-        <item android:id="@+id/back_menu_id"
-            android:alphabeticShortcut="j" />
+        <item android:id="@+id/back_menu_id" />
         <item android:id="@+id/goto_menu_id"
             android:alphabeticShortcut="l" />
         <item android:id="@+id/close_menu_id"
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 84e5348..68b58f7 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -34,4 +34,5 @@
     <color name="bookmarkWidgetFaviconBackground">#23ffffff</color>
     <color name="bookmarkListFaviconBackground">#23ffffff</color>
     <color name="urlTextColor">#0E774A</color>
+    <color name="tabFaviconBackground">#FF555555</color>
 </resources>
diff --git a/res/values/dimensions.xml b/res/values/dimensions.xml
index d738288..b1e1d92 100644
--- a/res/values/dimensions.xml
+++ b/res/values/dimensions.xml
@@ -43,4 +43,5 @@
     <dimen name="tab_first_padding_left">12dp</dimen>
     <dimen name="list_favicon_padding">5dip</dimen>
     <dimen name="list_favicon_corner_radius">3dip</dimen>
+    <dimen name="tab_favicon_corner_radius">2dip</dimen>
 </resources>
diff --git a/src/com/android/browser/BaseUi.java b/src/com/android/browser/BaseUi.java
index 568a7e9..02d9199 100644
--- a/src/com/android/browser/BaseUi.java
+++ b/src/com/android/browser/BaseUi.java
@@ -32,6 +32,7 @@
 import android.view.Menu;
 import android.view.View;
 import android.view.View.OnClickListener;
+import android.view.View.OnKeyListener;
 import android.view.ViewGroup;
 import android.view.ViewGroup.LayoutParams;
 import android.view.WindowManager;
@@ -113,7 +114,6 @@
         mCustomViewContainer = (FrameLayout) mBrowserFrameLayout
                 .findViewById(R.id.fullscreen_custom_content);
         frameLayout.addView(mBrowserFrameLayout, COVER_SCREEN_PARAMS);
-
     }
 
     /**
@@ -286,6 +286,8 @@
             Log.w(LOGTAG, "mContainer is already attached to content in"
                     + " attachTabToContentView!");
         }
+        mainView.setNextFocusUpId(R.id.url_focused);
+        mainView.setNextFocusDownId(R.id.url_focused);
         mUiController.attachSubWindow(tab);
     }
 
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index a67b4e6..527f025 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -94,8 +94,6 @@
         if (((AccessibilityManager) getSystemService(ACCESSIBILITY_SERVICE))
                 .isEnabled()) {
             setDefaultKeyMode(DEFAULT_KEYS_DISABLE);
-        } else {
-            setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
         }
 
         mController = new Controller(this);
diff --git a/src/com/android/browser/CombinedBookmarkHistoryView.java b/src/com/android/browser/CombinedBookmarkHistoryView.java
index 734addd..173abba 100644
--- a/src/com/android/browser/CombinedBookmarkHistoryView.java
+++ b/src/com/android/browser/CombinedBookmarkHistoryView.java
@@ -244,14 +244,21 @@
     protected void onDetachedFromWindow() {
         super.onDetachedFromWindow();
         if (mCurrentFragment != INVALID_ID) {
-            FragmentManager fm = mActivity.getFragmentManager();
-            FragmentTransaction transaction = fm.beginTransaction();
-            if (mCurrentFragment == FRAGMENT_ID_BOOKMARKS) {
-                transaction.remove(mBookmarks);
-            } else if (mCurrentFragment == FRAGMENT_ID_HISTORY) {
-                transaction.remove(mHistory);
+            try {
+                FragmentManager fm = mActivity.getFragmentManager();
+                FragmentTransaction transaction = fm.beginTransaction();
+                if (mCurrentFragment == FRAGMENT_ID_BOOKMARKS) {
+                    transaction.remove(mBookmarks);
+                } else if (mCurrentFragment == FRAGMENT_ID_HISTORY) {
+                    transaction.remove(mHistory);
+                }
+                transaction.commit();
+            } catch (IllegalStateException ex) {
+                // This exception is thrown if the fragment isn't added
+                // This will happen if the activity is finishing, and the
+                // fragment was already removed before this view was detached
+                // Aka, success!
             }
-            transaction.commit();
             mCurrentFragment = INVALID_ID;
         }
         mUiController.unregisterOptionsMenuHandler(this);
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index 6c6fe0b..6113e54 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -63,7 +63,6 @@
 import android.view.ContextMenu.ContextMenuInfo;
 import android.view.Gravity;
 import android.view.KeyEvent;
-import android.view.LayoutInflater;
 import android.view.Menu;
 import android.view.MenuInflater;
 import android.view.MenuItem;
@@ -78,7 +77,6 @@
 import android.webkit.WebIconDatabase;
 import android.webkit.WebSettings;
 import android.webkit.WebView;
-import android.widget.TextView;
 
 import java.io.ByteArrayOutputStream;
 import java.io.File;
@@ -2020,7 +2018,6 @@
     }
 
     protected void reuseTab(Tab appTab, String appId, UrlData urlData) {
-        Log.i(LOGTAG, "Reusing tab for " + appId);
         // Dismiss the subwindow if applicable.
         dismissSubWindow(appTab);
         // Since we might kill the WebView, remove it from the
@@ -2195,12 +2192,9 @@
         removeComboView();
         int currentIndex = mTabControl.getCurrentIndex();
         int removeIndex = mTabControl.getTabIndex(tab);
-        removeTab(tab);
-        if (currentIndex >= removeIndex && currentIndex != 0) {
-            currentIndex--;
-        }
         Tab newtab = mTabControl.getTab(currentIndex);
         setActiveTab(newtab);
+        removeTab(tab);
     }
 
     /**************** TODO: Url loading clean up *******************************/
@@ -2413,67 +2407,28 @@
                     return true;
                 }
                 break;
-            case KeyEvent.KEYCODE_B:
-                if (ctrl) {
-                    bookmarksOrHistoryPicker(false);
-                    return true;
-                }
-                break;
+//          case KeyEvent.KEYCODE_B:    // menu
             case KeyEvent.KEYCODE_C:
                 if (ctrl) {
                     webView.copySelection();
                     return true;
                 }
                 break;
-            case KeyEvent.KEYCODE_D:
-                if (ctrl) {
-                    bookmarkCurrentPage(AddBookmarkPage.DEFAULT_FOLDER_ID);
-                    return true;
-                }
-                break;
+//          case KeyEvent.KEYCODE_D:    // menu
 //          case KeyEvent.KEYCODE_E:    // in Chrome: puts '?' in URL bar
-            case KeyEvent.KEYCODE_F:
-                if (ctrl) {
-                    webView.showFindDialog(null, true);
-                    return true;
-                }
-                break;
+//          case KeyEvent.KEYCODE_F:    // menu
 //          case KeyEvent.KEYCODE_G:    // in Chrome: finds next match
-            case KeyEvent.KEYCODE_H:
-                if (ctrl) {
-                    bookmarksOrHistoryPicker(true);
-                    return true;
-                }
-                break;
+//          case KeyEvent.KEYCODE_H:    // menu
 //          case KeyEvent.KEYCODE_I:    // unused
-            case KeyEvent.KEYCODE_J:
-                if (ctrl) {
-                    viewDownloads();
-                    return true;
-                }
-                break;
+//          case KeyEvent.KEYCODE_J:    // menu
 //          case KeyEvent.KEYCODE_K:    // in Chrome: puts '?' in URL bar
-            case KeyEvent.KEYCODE_L:
-                if (ctrl) {
-                    editUrl();
-                    return true;
-                }
-                break;
+//          case KeyEvent.KEYCODE_L:    // menu
 //          case KeyEvent.KEYCODE_M:    // unused
 //          case KeyEvent.KEYCODE_N:    // in Chrome: new window
 //          case KeyEvent.KEYCODE_O:    // in Chrome: open file
 //          case KeyEvent.KEYCODE_P:    // in Chrome: print page
 //          case KeyEvent.KEYCODE_Q:    // unused
-            case KeyEvent.KEYCODE_R:
-                if (ctrl) {
-                    if (mInLoad) {
-                        stopLoading();
-                    } else {
-                        webView.reload();
-                    }
-                    return true;
-                }
-                break;
+//            case KeyEvent.KEYCODE_R:
 //          case KeyEvent.KEYCODE_S:    // in Chrome: saves page
             case KeyEvent.KEYCODE_T:
                 if (ctrl) {
@@ -2487,17 +2442,13 @@
                 break;
 //          case KeyEvent.KEYCODE_U:    // in Chrome: opens source of page
 //          case KeyEvent.KEYCODE_V:    // text view intercepts to paste
-            case KeyEvent.KEYCODE_W:
-                if (ctrl) {
-                    closeCurrentTab();
-                    return true;
-                }
-                break;
+//          case KeyEvent.KEYCODE_W:    // menu
 //          case KeyEvent.KEYCODE_X:    // text view intercepts to cut
 //          case KeyEvent.KEYCODE_Y:    // unused
 //          case KeyEvent.KEYCODE_Z:    // unused
         }
-        return false;
+        // if we get here, it is a regular key and webview is not null
+        return mUi.dispatchKey(keyCode, event);
     }
 
     boolean onKeyUp(int keyCode, KeyEvent event) {
diff --git a/src/com/android/browser/PhoneUi.java b/src/com/android/browser/PhoneUi.java
index 99fc4a0..4119c29 100644
--- a/src/com/android/browser/PhoneUi.java
+++ b/src/com/android/browser/PhoneUi.java
@@ -22,6 +22,7 @@
 import android.util.Log;
 import android.view.ActionMode;
 import android.view.Gravity;
+import android.view.KeyEvent;
 import android.view.Menu;
 import android.view.View;
 import android.view.ViewGroup;
@@ -269,4 +270,9 @@
         hideFakeTitleBar();
     }
 
+    @Override
+    public boolean dispatchKey(int code, KeyEvent event) {
+        return false;
+    }
+
 }
diff --git a/src/com/android/browser/TabBar.java b/src/com/android/browser/TabBar.java
index 1ab02ed..790d162 100644
--- a/src/com/android/browser/TabBar.java
+++ b/src/com/android/browser/TabBar.java
@@ -18,13 +18,16 @@
 
 import com.android.browser.ScrollWebView.ScrollListener;
 
+import android.animation.Animator;
+import android.animation.Animator.AnimatorListener;
+import android.animation.AnimatorSet;
+import android.animation.ObjectAnimator;
 import android.app.Activity;
 import android.content.Context;
 import android.content.res.Resources;
 import android.graphics.Bitmap;
 import android.graphics.BitmapShader;
 import android.graphics.Canvas;
-import android.graphics.Color;
 import android.graphics.Matrix;
 import android.graphics.Paint;
 import android.graphics.Path;
@@ -151,6 +154,7 @@
         mTabMap.clear();
         for (Tab tab : tabs) {
             TabView tv = buildTabView(tab);
+            mTabs.addTab(tv);
         }
         mTabs.setSelectedTab(mTabControl.getCurrentIndex());
     }
@@ -286,7 +290,6 @@
         TabView tabview = new TabView(mActivity, tab);
         mTabMap.put(tab, tabview);
         tabview.setOnClickListener(this);
-        mTabs.addTab(tabview);
         return tabview;
     }
 
@@ -327,7 +330,7 @@
             mTab = tab;
             setGravity(Gravity.CENTER_VERTICAL);
             setOrientation(LinearLayout.HORIZONTAL);
-            setPadding(mTabPadding, 0, 0, 0);
+            setPadding(mTabOverlap, 0, mTabSliceWidth, 0);
             LayoutInflater inflater = LayoutInflater.from(getContext());
             mTabContent = inflater.inflate(R.layout.tab_title, this, true);
             mTitle = (TextView) mTabContent.findViewById(R.id.title);
@@ -346,6 +349,14 @@
         void showIndicator(boolean show) {
             if (mSelected) {
                 mIndicator.setVisibility(show ? View.VISIBLE : View.GONE);
+                LayoutParams lp = (LinearLayout.LayoutParams) getLayoutParams();
+                if (show) {
+                    lp.width = mTabWidthSelected + mIndicator.getWidth();
+                } else {
+                    lp.width = mTabWidthSelected;
+                }
+                lp.height =  LayoutParams.MATCH_PARENT;
+                setLayoutParams(lp);
             } else {
                 mIndicator.setVisibility(View.GONE);
             }
@@ -485,21 +496,86 @@
 
     }
 
+    static Drawable createFaviconBackground(Context context) {
+        PaintDrawable faviconBackground = new PaintDrawable();
+        Resources res = context.getResources();
+        faviconBackground.getPaint().setColor(context.getResources()
+                .getColor(R.color.tabFaviconBackground));
+        faviconBackground.setCornerRadius(
+                res.getDimension(R.dimen.tab_favicon_corner_radius));
+        return faviconBackground;
+    }
+
     private Drawable renderFavicon(Bitmap icon) {
-        Drawable[] array = new Drawable[3];
-        array[0] = new PaintDrawable(Color.BLACK);
-        array[1] = new PaintDrawable(Color.WHITE);
+        Drawable[] array = new Drawable[2];
+        array[0] = createFaviconBackground(getContext());
         if (icon == null) {
-            array[2] = mGenericFavicon;
+            array[1] = mGenericFavicon;
         } else {
-            array[2] = new BitmapDrawable(icon);
+            array[1] = new BitmapDrawable(icon);
         }
         LayerDrawable d = new LayerDrawable(array);
-        d.setLayerInset(1, 1, 1, 1, 1);
-        d.setLayerInset(2, 2, 2, 2, 2);
+        d.setLayerInset(1, 2, 2, 2, 2);
         return d;
     }
 
+    private void animateTabOut(final Tab tab, final TabView tv) {
+        ObjectAnimator scalex = ObjectAnimator.ofFloat(tv, "scaleX", 1.0f, 0.0f);
+        ObjectAnimator scaley = ObjectAnimator.ofFloat(tv, "scaleY", 1.0f, 0.0f);
+        ObjectAnimator alpha = ObjectAnimator.ofFloat(tv, "alpha", 1.0f, 0.0f);
+        AnimatorSet animator = new AnimatorSet();
+        animator.playTogether(scalex, scaley, alpha);
+        animator.setDuration(150);
+        animator.addListener(new AnimatorListener() {
+
+            @Override
+            public void onAnimationCancel(Animator animation) {
+            }
+
+            @Override
+            public void onAnimationEnd(Animator animation) {
+                mTabs.removeTab(tv);
+                mTabMap.remove(tab);
+            }
+
+            @Override
+            public void onAnimationRepeat(Animator animation) {
+            }
+
+            @Override
+            public void onAnimationStart(Animator animation) {
+            }
+
+        });
+        animator.start();
+    }
+
+    private void animateTabIn(final Tab tab, final TabView tv) {
+        ObjectAnimator scalex = ObjectAnimator.ofFloat(tv, "scaleX", 0.0f, 1.0f);
+        scalex.setDuration(150);
+        scalex.addListener(new AnimatorListener() {
+
+            @Override
+            public void onAnimationCancel(Animator animation) {
+            }
+
+            @Override
+            public void onAnimationEnd(Animator animation) {
+            }
+
+            @Override
+            public void onAnimationRepeat(Animator animation) {
+            }
+
+            @Override
+            public void onAnimationStart(Animator animation) {
+                mTabs.addTab(tv);
+            }
+
+        });
+        scalex.start();
+    }
+
     // TabChangeListener implementation
 
     public void onSetActiveTab(Tab tab) {
@@ -526,6 +602,7 @@
 
     public void onNewTab(Tab tab) {
         TabView tv = buildTabView(tab);
+        animateTabIn(tab, tv);
     }
 
     public void onProgress(Tab tab, int progress) {
@@ -538,9 +615,10 @@
     public void onRemoveTab(Tab tab) {
         TabView tv = mTabMap.get(tab);
         if (tv != null) {
-            mTabs.removeTab(tv);
+            animateTabOut(tab, tv);
+        } else {
+            mTabMap.remove(tab);
         }
-        mTabMap.remove(tab);
     }
 
     public void onUrlAndTitle(Tab tab, String url, String title) {
diff --git a/src/com/android/browser/TitleBarXLarge.java b/src/com/android/browser/TitleBarXLarge.java
index 4822cc0..6caacdc 100644
--- a/src/com/android/browser/TitleBarXLarge.java
+++ b/src/com/android/browser/TitleBarXLarge.java
@@ -60,6 +60,7 @@
     private ImageButton mBackButton;
     private ImageButton mForwardButton;
     private ImageView mStar;
+    private ImageView mWebIcon;
     private View mSearchButton;
     private View mUrlContainer;
     private View mGoButton;
@@ -105,6 +106,7 @@
         // back/forward.  Probably should be done inside onPageStarted.
         mBackButton = (ImageButton) findViewById(R.id.back);
         mForwardButton = (ImageButton) findViewById(R.id.forward);
+        mWebIcon = (ImageView) findViewById(R.id.web_icon);
         mStar = (ImageView) findViewById(R.id.star);
         mStopButton = (ImageView) findViewById(R.id.stop);
         mSearchButton = findViewById(R.id.search);
@@ -340,6 +342,7 @@
             if (mInVoiceMode) {
                 mVoiceSearchIndicator.setVisibility(View.VISIBLE);
             }
+            mWebIcon.setImageResource(R.drawable.ic_search_holo_dark);
             updateSearchMode();
         } else {
             mUrlInput.clearFocus();
@@ -353,6 +356,7 @@
             } else {
                 mSearchButton.setVisibility(View.VISIBLE);
             }
+            mWebIcon.setImageResource(R.drawable.ic_web_holo_dark);
         }
     }
 
diff --git a/src/com/android/browser/UI.java b/src/com/android/browser/UI.java
index 4738522..8de2b19 100644
--- a/src/com/android/browser/UI.java
+++ b/src/com/android/browser/UI.java
@@ -20,6 +20,7 @@
 import android.graphics.Bitmap;
 import android.os.Bundle;
 import android.view.ActionMode;
+import android.view.KeyEvent;
 import android.view.Menu;
 import android.view.View;
 import android.webkit.WebChromeClient.CustomViewCallback;
@@ -117,4 +118,6 @@
 
     void showMaxTabsWarning();
 
+    boolean dispatchKey(int code, KeyEvent event);
+
 }
diff --git a/src/com/android/browser/XLargeUi.java b/src/com/android/browser/XLargeUi.java
index a9cc9fe..2f27aa1 100644
--- a/src/com/android/browser/XLargeUi.java
+++ b/src/com/android/browser/XLargeUi.java
@@ -24,6 +24,7 @@
 import android.util.Log;
 import android.view.ActionMode;
 import android.view.Gravity;
+import android.view.KeyEvent;
 import android.view.View;
 import android.webkit.WebChromeClient.CustomViewCallback;
 import android.webkit.WebView;
@@ -396,4 +397,24 @@
             mActivity.getActionBar().show();
         }
     }
+
+    @Override
+    public boolean dispatchKey(int code, KeyEvent event) {
+        WebView web = getActiveTab().getWebView();
+        switch (code) {
+            case KeyEvent.KEYCODE_TAB:
+            case KeyEvent.KEYCODE_DPAD_UP:
+            case KeyEvent.KEYCODE_DPAD_LEFT:
+                if ((web != null) && web.hasFocus()) {
+                    editUrl(true);
+                    return true;
+                }
+        }
+        if (event.isPrintingKey() && !mFakeTitleBar.isEditingUrl()) {
+            editUrl(true);
+            return mContentView.dispatchKeyEvent(event);
+        }
+        return false;
+    }
+
 }
diff --git a/src/com/android/browser/preferences/PrivacySecurityPreferencesFragment.java b/src/com/android/browser/preferences/PrivacySecurityPreferencesFragment.java
index c0cf3cf..91705e5 100644
--- a/src/com/android/browser/preferences/PrivacySecurityPreferencesFragment.java
+++ b/src/com/android/browser/preferences/PrivacySecurityPreferencesFragment.java
@@ -44,6 +44,11 @@
 
         Preference e = findPreference(BrowserSettings.PREF_CLEAR_HISTORY);
         e.setOnPreferenceChangeListener(this);
+    }
+
+    @Override
+    public void onResume() {
+        super.onResume();
         setupAutoLoginPreference();
     }
 
@@ -66,6 +71,8 @@
         values[i] = "";
         autologinPref.setEntries(names);
         autologinPref.setEntryValues(values);
+        autologinPref.setValue(BrowserSettings.getInstance()
+                .getAutoLoginAccount(getActivity()));
     }
 
     private void updateAutoLoginSummary(Preference pref) {