Add incognito and snapshot icons to tab switcher

 Bug: 5162768

Change-Id: Ie0e1af52d26d236f666c26e2aaccaf4f9f28eb95
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index c6808e0..abc2467 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -191,10 +191,12 @@
         String mTitle;
         LockIcon mLockIcon;
         Bitmap mFavicon;
-        Boolean mIsBookmarkedSite = false;
+        boolean mIsBookmarkedSite = false;
+        boolean mIncognito = false;
 
         PageState(Context c, boolean incognito) {
-            if (incognito) {
+            mIncognito = incognito;
+            if (mIncognito) {
                 mOriginalUrl = mUrl = "browser:incognito";
                 mTitle = c.getString(R.string.new_incognito_tab);
             } else {
@@ -206,6 +208,7 @@
         }
 
         PageState(Context c, boolean incognito, String url, Bitmap favicon) {
+            mIncognito = incognito;
             mOriginalUrl = mUrl = url;
             mTitle = null;
             if (URLUtil.isHttpsUrl(url)) {
@@ -913,6 +916,7 @@
             // but before a provisional load occurred
             mCurrentState.mLockIcon = LockIcon.LOCK_ICON_UNSECURE;
         }
+        mCurrentState.mIncognito = view.isPrivateBrowsingEnabled();
     }
 
     // Called by DeviceAccountLogin when the Tab needs to have the auto-login UI
@@ -1746,11 +1750,7 @@
      * @return True if private browsing is enabled.
      */
     boolean isPrivateBrowsingEnabled() {
-        WebView webView = getWebView();
-        if (webView == null) {
-            return false;
-        }
-        return webView.isPrivateBrowsingEnabled();
+        return mCurrentState.mIncognito;
     }
 
     /**