Make WebView inactive when title bar takes focus.
Bug:3296938 Change-Id: I656e8582044acf3b0e9b417f41337833fe72c181
This commit is contained in:
@@ -132,6 +132,9 @@ import junit.framework.Assert;
|
||||
private boolean mAutoFillable; // Is this textview part of an autofillable form?
|
||||
private int mQueryId;
|
||||
private boolean mAutoFillProfileIsSet;
|
||||
// Used to determine whether onFocusChanged was called as a result of
|
||||
// calling remove().
|
||||
private boolean mInsideRemove;
|
||||
|
||||
// Types used with setType. Keep in sync with CachedInput.h
|
||||
private static final int NORMAL_TEXT_FIELD = 0;
|
||||
@@ -540,6 +543,11 @@ import junit.framework.Assert;
|
||||
Rect previouslyFocusedRect) {
|
||||
mFromFocusChange = true;
|
||||
super.onFocusChanged(focused, direction, previouslyFocusedRect);
|
||||
if (focused) {
|
||||
mWebView.setActive(true);
|
||||
} else if (!mInsideRemove) {
|
||||
mWebView.setActive(false);
|
||||
}
|
||||
mFromFocusChange = false;
|
||||
}
|
||||
|
||||
@@ -770,8 +778,10 @@ import junit.framework.Assert;
|
||||
if (imm.isActive(this)) {
|
||||
imm.hideSoftInputFromWindow(getWindowToken(), 0);
|
||||
}
|
||||
mInsideRemove = true;
|
||||
mWebView.removeView(this);
|
||||
mWebView.requestFocus();
|
||||
mInsideRemove = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5050,7 +5050,7 @@ public class WebView extends AbsoluteLayout
|
||||
public void onGlobalFocusChanged(View oldFocus, View newFocus) {
|
||||
}
|
||||
|
||||
private void setActive(boolean active) {
|
||||
void setActive(boolean active) {
|
||||
if (active) {
|
||||
if (hasFocus()) {
|
||||
// If our window regained focus, and we have focus, then begin
|
||||
|
||||
Reference in New Issue
Block a user