summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/BaseUi.java
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2010-11-29 17:27:06 -0800
committerMichael Kolb <kolby@google.com>2010-11-30 12:34:50 -0800
commita713ec8cc9da6c0c8078cd297c6240eb8bf01bbb (patch)
tree67857d18222bf215ab2637fa169a08bc857368b4 /src/com/android/browser/BaseUi.java
parent51b83ee47643f2634b1e7e2651943b96e57c3a69 (diff)
downloadpackages_apps_Browser-a713ec8cc9da6c0c8078cd297c6240eb8bf01bbb.zip
packages_apps_Browser-a713ec8cc9da6c0c8078cd297c6240eb8bf01bbb.tar.gz
packages_apps_Browser-a713ec8cc9da6c0c8078cd297c6240eb8bf01bbb.tar.bz2
Move Tab layout code to UI
Change-Id: Ic2d81345883bba22329b4f805c44a68b14e174e3
Diffstat (limited to 'src/com/android/browser/BaseUi.java')
-rw-r--r--src/com/android/browser/BaseUi.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/com/android/browser/BaseUi.java b/src/com/android/browser/BaseUi.java
index 5f8944f..2b3a9e5 100644
--- a/src/com/android/browser/BaseUi.java
+++ b/src/com/android/browser/BaseUi.java
@@ -427,6 +427,24 @@ public class BaseUi implements UI, WebViewFactory {
mainView.setEmbeddedTitleBar(null);
}
+ @Override
+ public void onSetWebView(Tab tab, WebView webView) {
+ View container = tab.getViewContainer();
+ if (container == null) {
+ // The tab consists of a container view, which contains the main
+ // WebView, as well as any other UI elements associated with the tab.
+ container = mActivity.getLayoutInflater().inflate(R.layout.tab,
+ null);
+ tab.setViewContainer(container);
+ }
+ if (tab.getWebView() != webView) {
+ // Just remove the old one.
+ FrameLayout wrapper =
+ (FrameLayout) container.findViewById(R.id.webview_wrapper);
+ wrapper.removeView(tab.getWebView());
+ }
+ }
+
/**
* create a sub window container and webview for the tab
* Note: this methods operates through side-effects for now