Index: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
index f371caa4260f1612dc7d27d2a29bc5b1ece486da..e79a9db4c93445a7b59a65aade38e249f0df65f9 100644 |
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
@@ -1632,25 +1632,13 @@ |
mFocusPreOSKViewportRect.setEmpty(); |
} |
- private void updateNativeFocus() { |
- if (mNativeContentViewCore != 0) nativeSetFocus(mNativeContentViewCore, hasFocus()); |
- } |
- |
/** |
* @see View#onWindowFocusChanged(boolean) |
*/ |
public void onWindowFocusChanged(boolean hasWindowFocus) { |
- // http://crbug.com/495547: View's focus status isn't changed even when Window's focus |
- // status is changed. But to receive key events, both View and its Window must have focus. |
- // So blinking a cursor in an input area doesn't make sense when Window's focus is lost |
- // even though |mContainerView| has focus. |
- updateNativeFocus(); |
if (!hasWindowFocus) resetGestureDetection(); |
} |
- /** |
- * @see View#onFocusChanged(boolean) |
- */ |
public void onFocusChanged(boolean gainFocus) { |
if (gainFocus) { |
restoreSelectionPopupsIfNecessary(); |
@@ -1668,7 +1656,7 @@ |
clearUserSelection(); |
} |
} |
- updateNativeFocus(); |
+ if (mNativeContentViewCore != 0) nativeSetFocus(mNativeContentViewCore, gainFocus); |
} |
/** |
@@ -2628,16 +2616,14 @@ |
} |
/** |
- * ContentViewCore has focus when both mContainerView.hasFocus() and |
- * mContainerView.hasWindowFocus() are true. |
- * @see View#hasFocus() and View#hasWindowFocus() |
+ * @see View#hasFocus() |
*/ |
@CalledByNative |
private boolean hasFocus() { |
// If the container view is not focusable, we consider it always focused from |
// Chromium's point of view. |
if (!mContainerView.isFocusable()) return true; |
- return mContainerView.hasFocus() && mContainerView.hasWindowFocus(); |
+ return mContainerView.hasFocus(); |
} |
/** |