summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2010-12-05 13:23:24 -0800
committerMichael Kolb <kolby@google.com>2010-12-06 15:26:17 -0800
commit3a696280cba53eea153c9d5707b236997d193328 (patch)
tree3d0b4b1f1bad0a7e695e48faed968148c1fc2d75 /src
parent41d3b94fdb805dec53a3103e3db7b427834097d0 (diff)
downloadpackages_apps_Browser-3a696280cba53eea153c9d5707b236997d193328.zip
packages_apps_Browser-3a696280cba53eea153c9d5707b236997d193328.tar.gz
packages_apps_Browser-3a696280cba53eea153c9d5707b236997d193328.tar.bz2
fix ComboPage dialog/popup/IME bug
Bug 3166409 Put the tab in background while ComboPage is up this prevents dialogs from getting displayed Bug 3215897 make sure the IME is closed before ComboPage is displayed Change-Id: If832e040e2fa9acb12f45a3e9f681d1fd333f3b0
Diffstat (limited to 'src')
-rw-r--r--src/com/android/browser/BaseUi.java21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/com/android/browser/BaseUi.java b/src/com/android/browser/BaseUi.java
index 6ae6f1b..b39cb43 100644
--- a/src/com/android/browser/BaseUi.java
+++ b/src/com/android/browser/BaseUi.java
@@ -38,6 +38,7 @@ import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.WindowManager;
+import android.view.inputmethod.InputMethodManager;
import android.webkit.WebChromeClient;
import android.webkit.WebHistoryItem;
import android.webkit.WebView;
@@ -70,6 +71,7 @@ public class BaseUi implements UI, WebViewFactory {
UiController mUiController;
TabControl mTabControl;
private Tab mActiveTab;
+ private InputMethodManager mInputManager;
private Drawable mSecLockIcon;
private Drawable mMixLockIcon;
@@ -107,6 +109,8 @@ public class BaseUi implements UI, WebViewFactory {
mUiController = controller;
mTabControl = controller.getTabControl();
Resources res = mActivity.getResources();
+ mInputManager = (InputMethodManager)
+ browser.getSystemService(Activity.INPUT_METHOD_SERVICE);
mSecLockIcon = res.getDrawable(R.drawable.ic_secure);
mMixLockIcon = res.getDrawable(R.drawable.ic_partial_secure);
@@ -583,6 +587,11 @@ public class BaseUi implements UI, WebViewFactory {
extras);
mTitleBar.setVisibility(View.GONE);
hideFakeTitleBar();
+ dismissIME();
+ if (mActiveTab != null) {
+ WebView web = mActiveTab.getWebView();
+ mActiveTab.putInBackground();
+ }
mContentView.addView(mComboView, COVER_SCREEN_PARAMS);
}
@@ -596,6 +605,9 @@ public class BaseUi implements UI, WebViewFactory {
mTitleBar.setVisibility(View.VISIBLE);
mComboView = null;
}
+ if (mActiveTab != null) {
+ mActiveTab.putInForeground();
+ }
}
@Override
@@ -658,6 +670,13 @@ public class BaseUi implements UI, WebViewFactory {
mFakeTitleBar.setDisplayTitle(url);
}
+ private void dismissIME() {
+ if (mInputManager.isActive()) {
+ mInputManager.hideSoftInputFromWindow(mContentView.getWindowToken(),
+ 0);
+ }
+ }
+
// -------------------------------------------------------------------------
@Override
@@ -745,8 +764,6 @@ public class BaseUi implements UI, WebViewFactory {
/**
* Remove the active tabs page.
- * @param needToAttach If true, the active tabs page did not attach a tab
- * to the content view, so we need to do that here.
*/
public void removeActiveTabsPage() {
mContentView.removeView(mActiveTabsPage);