// we do not need to remove it
removeTabFromContentView(currentTab);
}
- removeTabFromContentView(tab);
mTabControl.setCurrentTab(tab);
attachTabToContentView(tab);
- resetTitle();
+ resetTitleIconAndProgress();
+ updateLockIconToLatest();
return true;
}
ViewGroup.LayoutParams.WRAP_CONTENT));
}
+ if (t == mTabControl.getCurrentTab()) {
+ setLockIconType(t.getLockIconType());
+ setPrevLockType(t.getPrevLockIconType());
+ }
+
WebView view = t.getWebView();
view.setEmbeddedTitleBar(mTitleBar);
// Attach the sub window if necessary
if (t.getSubWebView() != null) {
mContentView.removeView(t.getSubWebViewContainer());
}
+
+ if (t == mTabControl.getCurrentTab()) {
+ t.setLockIconType(getLockIconType());
+ t.setPrevLockIconType(getPrevLockType());
+ }
}
// Remove the sub window if it exists. Also called by TabControl when the
if (currentTab != null) {
removeTabFromContentView(currentTab);
}
- attachTabToContentView(tab);
// We must set the new tab as the current tab to reflect the old
// animation behavior.
mTabControl.setCurrentTab(tab);
+ attachTabToContentView(tab);
if (!urlData.isEmpty()) {
urlData.loadIn(webview);
}
}
/**
- * Resets the browser title-view to whatever it must be (for example, if we
- * load a page from history).
- */
- private void resetTitle() {
- resetLockIcon();
- resetTitleIconAndProgress();
- }
-
- /**
* Resets the browser title-view to whatever it must be
* (for example, if we had a loading error)
* When we have a new page, we call resetTitle, when we
updateLockIconImage(LOCK_ICON_UNSECURE);
}
- /**
- * Resets the lock icon. This method is called when the icon needs to be
- * reset but we do not know whether we are loading a secure or not secure
- * page.
- */
- private void resetLockIcon() {
- // Save the lock-icon state (we revert to it if the load gets cancelled)
- saveLockIcon();
+ /* package */ void setLockIconType(int type) {
+ mLockIconType = type;
+ }
- mLockIconType = LOCK_ICON_UNSECURE;
+ /* package */ int getLockIconType() {
+ return mLockIconType;
+ }
- if (LOGV_ENABLED) {
- Log.v(LOGTAG, "BrowserActivity.resetLockIcon:" +
- " reset lock icon to " + mLockIconType);
- }
+ /* package */ void setPrevLockType(int type) {
+ mPrevLockType = type;
+ }
- updateLockIconImage(LOCK_ICON_UNSECURE);
+ /* package */ int getPrevLockType() {
+ return mPrevLockType;
}
/**
}
- private final static int LOCK_ICON_UNSECURE = 0;
- private final static int LOCK_ICON_SECURE = 1;
- private final static int LOCK_ICON_MIXED = 2;
+ final static int LOCK_ICON_UNSECURE = 0;
+ final static int LOCK_ICON_SECURE = 1;
+ final static int LOCK_ICON_MIXED = 2;
private int mLockIconType = LOCK_ICON_UNSECURE;
private int mPrevLockType = LOCK_ICON_UNSECURE;
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.
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.