Fix the lock icon when switch tabs.
In switchToTab, I think it is wrong code where it calls removeTabFromContentView(tab).
In openTabAndShow, we should really attach after we the tab to the current.
Fix http://b/issue?id=2067930
diff --git a/src/com/android/browser/TabControl.java b/src/com/android/browser/TabControl.java
index 037a757..4089cac 100644
--- a/src/com/android/browser/TabControl.java
+++ b/src/com/android/browser/TabControl.java
@@ -210,12 +210,17 @@
private String mOriginalUrl;
private ErrorConsoleView mErrorConsole;
+ // the lock icon type and previous lock icon type for the tab
+ private int mSavedLockIconType;
+ private int mSavedPrevLockIconType;
// Construct a new tab
private Tab(WebView w, boolean closeOnExit, String appId, String url, Context context) {
mCloseOnExit = closeOnExit;
mAppId = appId;
mOriginalUrl = url;
+ mSavedLockIconType = BrowserActivity.LOCK_ICON_UNSECURE;
+ mSavedPrevLockIconType = BrowserActivity.LOCK_ICON_UNSECURE;
// The tab consists of a container view, which contains the main
// WebView, as well as any other UI elements associated with the tab.
@@ -413,6 +418,22 @@
mPickerData.mFakeWebView.invalidate();
}
}
+
+ void setLockIconType(int type) {
+ mSavedLockIconType = type;
+ }
+
+ int getLockIconType() {
+ return mSavedLockIconType;
+ }
+
+ void setPrevLockIconType(int type) {
+ mSavedPrevLockIconType = type;
+ }
+
+ int getPrevLockIconType() {
+ return mSavedPrevLockIconType;
+ }
};
// Directory to store thumbnails for each WebView.