new iteration of the navigation UI

    use live webviews

Change-Id: Ie787c76470e445548d358374f83f33a1b0b0b5cf
diff --git a/res/drawable/navtab_close_background.xml b/res/drawable/navtab_close_background.xml
new file mode 100644
index 0000000..e20cc5c
--- /dev/null
+++ b/res/drawable/navtab_close_background.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 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:state_pressed="false" android:drawable="@drawable/bookmarks_widget_thumb_selector_focused" />
+    <item android:state_pressed="true" android:drawable="@drawable/bookmark_thumb_selector_transition" />
+    <item android:drawable="@color/navtab_bg" />
+</selector>
+
diff --git a/res/layout-land/nav_screen.xml b/res/layout-land/nav_screen.xml
index 0186b6f..846b809 100644
--- a/res/layout-land/nav_screen.xml
+++ b/res/layout-land/nav_screen.xml
@@ -14,17 +14,24 @@
      limitations under the License.
 -->
 
-<LinearLayout
+<RelativeLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/nav_screen"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="horizontal">
+    android:layout_height="match_parent" >
     <LinearLayout
-        android:id="@+id/navtop"
-        android:layout_height="match_parent"
-        android:layout_width="44dip"
+        android:id="@+id/titlebar"
+        android:orientation="horizontal"
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/toolbar_height"
+        android:background="@drawable/bg_urlbar" />
+    <LinearLayout
+        android:id="@+id/tabbar"
         android:orientation="vertical"
+        android:layout_width="44dip"
+        android:layout_height="match_parent"
+        android:layout_below="@id/titlebar"
+        android:layout_alignParentRight="true"
         android:background="#80404040">
         <ImageButton
             android:id="@+id/newtab"
@@ -43,13 +50,12 @@
             android:gravity="center_vertical"
             android:src="@drawable/ic_new_incognito_holo_dark" />
         <ImageButton
-            android:id="@+id/tabs"
+            android:id="@+id/bookmarks"
             android:layout_height="0dip"
             android:layout_weight="0.25"
             android:layout_width="match_parent"
-            style="@style/HoloButton"
-            android:gravity="center_vertical"
-            android:src="@drawable/ic_windows_holo_dark" />
+            android:src="@drawable/ic_bookmarks_history_holo_dark"
+            style="@style/HoloButton" />
         <ImageButton
             android:id="@+id/more"
             android:layout_height="0dip"
@@ -59,46 +65,11 @@
             android:gravity="center_vertical"
             android:src="@*android:drawable/ic_menu_moreoverflow_normal_holo_dark" />
     </LinearLayout>
-    <FrameLayout
-        android:id="@+id/galleryholder"
+    <com.android.browser.NavTabScroller
+        android:id="@+id/scroller"
+        android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:layout_width="0dip"
-        android:layout_weight="1"
-        android:paddingTop="5dp"
-        android:paddingBottom="5dp" />
-    <LinearLayout
-        android:id="@+id/navbar"
-        android:layout_height="match_parent"
-        android:layout_width="44dip"
-        android:orientation="vertical"
-        android:background="#80404040">
-        <ImageButton
-            android:id="@+id/back"
-            android:layout_width="match_parent"
-            android:layout_weight="0.25"
-            android:layout_height="0dip"
-            android:src="@drawable/ic_back_holo_dark"
-            style="@style/HoloButton" />
-        <ImageButton
-            android:id="@+id/refresh"
-            android:layout_width="match_parent"
-            android:layout_weight="0.25"
-            android:layout_height="0dip"
-            android:src="@drawable/ic_refresh_holo_dark"
-            style="@style/HoloButton" />
-        <ImageButton
-            android:id="@+id/forward"
-            android:layout_width="match_parent"
-            android:layout_weight="0.25"
-            android:layout_height="0dip"
-            android:src="@drawable/ic_forward_holo_dark"
-            style="@style/HoloButton" />
-        <ImageButton
-            android:id="@+id/bookmarks"
-            android:layout_width="match_parent"
-            android:layout_weight="0.25"
-            android:layout_height="0dip"
-            android:src="@drawable/ic_bookmarks_history_holo_dark"
-            style="@style/HoloButton" />
-    </LinearLayout>
-</LinearLayout>
+        android:layout_toLeftOf="@id/tabbar"
+        android:paddingTop="0dp"
+        android:paddingBottom="10dp" />
+</RelativeLayout>
diff --git a/res/layout/nav_screen.xml b/res/layout/nav_screen.xml
index 2170154..82f783b 100644
--- a/res/layout/nav_screen.xml
+++ b/res/layout/nav_screen.xml
@@ -14,16 +14,24 @@
      limitations under the License.
 -->
 
-<LinearLayout
+<RelativeLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/nav_screen"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:orientation="vertical">
     <LinearLayout
-        android:id="@+id/navtop"
+        android:id="@+id/titlebar"
+        android:orientation="horizontal"
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/toolbar_height"
+        android:background="@drawable/bg_urlbar" />
+    <LinearLayout
+        android:id="@+id/tabbar"
+        android:orientation="horizontal"
         android:layout_width="match_parent"
         android:layout_height="44dip"
+        android:layout_alignParentBottom="true"
         android:background="#80404040">
         <ImageButton
             android:id="@+id/newtab"
@@ -42,13 +50,12 @@
             android:gravity="center_vertical"
             android:src="@drawable/ic_new_incognito_holo_dark" />
         <ImageButton
-            android:id="@+id/tabs"
+            android:id="@+id/bookmarks"
             android:layout_width="0dip"
             android:layout_weight="0.25"
             android:layout_height="match_parent"
-            style="@style/HoloButton"
-            android:gravity="center_vertical"
-            android:src="@drawable/ic_windows_holo_dark" />
+            android:src="@drawable/ic_bookmarks_history_holo_dark"
+            style="@style/HoloButton" />
         <ImageButton
             android:id="@+id/more"
             android:layout_width="0dip"
@@ -58,46 +65,11 @@
             android:gravity="center_vertical"
             android:src="@*android:drawable/ic_menu_moreoverflow_normal_holo_dark" />
     </LinearLayout>
-    <FrameLayout
-        android:id="@+id/galleryholder"
+    <com.android.browser.NavTabScroller
+        android:id="@+id/scroller"
         android:layout_width="match_parent"
-        android:layout_height="0dip"
-        android:layout_weight="1"
-        android:paddingTop="5dp"
-        android:paddingBottom="5dp" />
-    <LinearLayout
-        android:id="@+id/navbar"
-        android:orientation="horizontal"
-        android:layout_width="match_parent"
-        android:layout_height="44dip"
-        android:background="#80404040">
-        <ImageButton
-            android:id="@+id/back"
-            android:layout_width="0dip"
-            android:layout_weight="0.25"
-            android:layout_height="match_parent"
-            android:src="@drawable/ic_back_holo_dark"
-            style="@style/HoloButton" />
-        <ImageButton
-            android:id="@+id/refresh"
-            android:layout_width="0dip"
-            android:layout_weight="0.25"
-            android:layout_height="match_parent"
-            android:src="@drawable/ic_refresh_holo_dark"
-            style="@style/HoloButton" />
-        <ImageButton
-            android:id="@+id/forward"
-            android:layout_width="0dip"
-            android:layout_weight="0.25"
-            android:layout_height="match_parent"
-            android:src="@drawable/ic_forward_holo_dark"
-            style="@style/HoloButton" />
-        <ImageButton
-            android:id="@+id/bookmarks"
-            android:layout_width="0dip"
-            android:layout_weight="0.25"
-            android:layout_height="match_parent"
-            android:src="@drawable/ic_bookmarks_history_holo_dark"
-            style="@style/HoloButton" />
-    </LinearLayout>
-</LinearLayout>
+        android:layout_height="match_parent"
+        android:layout_above="@id/tabbar"
+        android:paddingTop="0dp"
+        android:paddingBottom="10dp" />
+</RelativeLayout>
diff --git a/res/layout/nav_tab_view.xml b/res/layout/nav_tab_view.xml
index f657f4f..5b9cb9f 100644
--- a/res/layout/nav_tab_view.xml
+++ b/res/layout/nav_tab_view.xml
@@ -14,20 +14,24 @@
      limitations under the License.
 -->
 
-<com.android.browser.view.TabHolderView
+<LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/tab_view"
+    android:id="@+id/main"
     android:layout_width="wrap_content"
     android:layout_height="match_parent"
+    android:paddingLeft="4dp"
+    android:paddingRight="4dp"
     android:orientation="vertical"
-    android:padding="4dip"
-    android:focusable="false"
-    android:background="@drawable/nav_tab_bg">
+    android:focusable="false">
     <LinearLayout
         android:id="@+id/titlebar"
         android:orientation="horizontal"
         android:layout_width="match_parent"
-        android:layout_height="@dimen/toolbar_height" >
+        android:layout_height="@dimen/toolbar_height"
+        android:paddingLeft="4dip"
+        android:paddingRight="4dip"
+        android:paddingTop="2dip"
+        android:paddingBottom="2dip">
         <ImageView
             android:id="@+id/favicon"
             android:layout_width="20dip"
@@ -38,30 +42,42 @@
         <TextView
             android:id="@+id/title"
             android:layout_width="0dip"
-            android:layout_height="wrap_content"
+            android:layout_height="match_parent"
             android:layout_weight="1.0"
-            android:textSize="14dip"
-            android:textColor="@color/white"
+            android:gravity="center_vertical"
             android:singleLine="true"
             android:ellipsize="end"
             android:lines="1"
+            android:background="@*android:drawable/edit_text_holo_dark"
+            android:textAppearance="?android:attr/textAppearanceMedium"
             android:scrollHorizontally="true"
-            android:hint="@string/search_hint"
-            android:layout_gravity="center_vertical" />
+            android:hint="@string/search_hint" />
+        <ImageButton
+            android:id="@+id/refresh"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:src="@drawable/ic_refresh_holo_dark"
+            style="@style/HoloButton" />
+        <ImageButton
+            android:id="@+id/forward"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:src="@drawable/ic_forward_holo_dark"
+            style="@style/HoloButton" />
+    </LinearLayout>
+    <FrameLayout
+        android:id="@+id/tab_view"
+        android:layout_width="@dimen/nav_tab_width"
+        android:layout_height="@dimen/nav_tab_height"
+        android:padding="4dip"
+        android:focusable="false"
+        android:background="@drawable/nav_tab_bg">
         <ImageButton
             android:id="@+id/closetab"
             android:src="@drawable/ic_stop_holo_dark"
             android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:layout_gravity="center_vertical"
-            android:paddingLeft="4dip"
-            android:background="@drawable/bookmark_thumb_selector"
-            />
-    </LinearLayout>
-    <ImageView
-        android:id="@+id/content"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:adjustViewBounds="true"
-        android:scaleType="fitXY" />
-</com.android.browser.view.TabHolderView>
+            android:layout_height="wrap_content"
+            android:layout_gravity="right|top"
+            android:background="@drawable/navtab_close_background" />
+    </FrameLayout>
+</LinearLayout>
diff --git a/res/layout/title_bar.xml b/res/layout/title_bar.xml
index d00a56c..649a4a0 100644
--- a/res/layout/title_bar.xml
+++ b/res/layout/title_bar.xml
@@ -77,8 +77,13 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_gravity="center_vertical"
-            android:src="@drawable/ic_stop_holo_dark"
-            android:visibility="gone" />
+            android:src="@drawable/ic_stop_holo_dark" />
+        <ImageButton
+            android:id="@+id/forward"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:src="@drawable/ic_forward_holo_dark"
+            style="@style/HoloButton" />
     </LinearLayout>
     <LinearLayout
         android:id="@+id/autologin"
diff --git a/res/menu/browser.xml b/res/menu/browser.xml
index d9e884b..90357e9 100644
--- a/res/menu/browser.xml
+++ b/res/menu/browser.xml
@@ -43,6 +43,10 @@
                 android:icon="@*android:drawable/ic_menu_forward" />
         </group>
         <item
+            android:id="@+id/incognito_menu_id"
+            android:title="@string/incognito_tab"
+            android:icon="@drawable/ic_new_incognito_holo_dark" />
+        <item
             android:id="@+id/add_bookmark_menu_id"
             android:title="@string/save_to_bookmarks"
             android:icon="@drawable/ic_bookmark_on_holo_dark"
diff --git a/res/values-land/dimensions.xml b/res/values-land/dimensions.xml
index f3b1235..cd8fbaf 100644
--- a/res/values-land/dimensions.xml
+++ b/res/values-land/dimensions.xml
@@ -15,4 +15,6 @@
     <dimen name="preference_screen_side_margin">96dp</dimen>
     <dimen name="preference_screen_side_margin_negative">-100dp</dimen>
     <dimen name="preference_widget_width">72dp</dimen>
+    <dimen name="nav_tab_width">300dip</dimen>
+    <dimen name="nav_tab_height">300dip</dimen>
 </resources>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 15a5c87..322a80a 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -37,4 +37,5 @@
     <color name="qc_normal">#C02447B2</color>
     <color name="qc_selected">#D0102052</color>
     <color name="tabViewTitleBackground">#D0000000</color>
+    <color name="navtab_bg">#80606060</color>
 </resources>
diff --git a/res/values/dimensions.xml b/res/values/dimensions.xml
index a3404a3..10ed66e 100644
--- a/res/values/dimensions.xml
+++ b/res/values/dimensions.xml
@@ -69,4 +69,7 @@
     <dimen name="menu_width">240dip</dimen>
     <dimen name="toolbar_height">52dip</dimen>
     <dimen name="tab_capture_size">480dp</dimen>
+    <dimen name="nav_tab_width">280dip</dimen>
+    <dimen name="nav_tab_height">400dip</dimen>
+    <dimen name="nav_scroller_padding">40dip</dimen>
 </resources>