Commit aab0a28a authored by jaekyun's avatar jaekyun Committed by Commit bot

Revert of Change focus status according to the change of window focus...

Revert of Change focus status according to the change of window focus (patchset #5 id:80001 of https://codereview.chromium.org/1164033002/)

Reason for revert:
This CL caused http://crbug.com/498631.

Original issue's description:
> Change focus status according to the change of window focus
>
> On Android, View's focus status isn't changed when window focus is lost.
> So we should update ContentViewCore's focus status according to the
> change of window focus.
>
> BUG=495547
>
> Committed: https://crrev.com/98d5087ecd03ed36ec2e161102b71dad97a92b4c
> Cr-Commit-Position: refs/heads/master@{#333446}

TBR=jdduke@chromium.org,tedchoc@chromium.org,boliu@chromium.org,ajith.v@samsung.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=495547

Review URL: https://codereview.chromium.org/1177483003

Cr-Commit-Position: refs/heads/master@{#333784}
parent a2bdc14d
......@@ -1626,25 +1626,13 @@ public class ContentViewCore implements
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();
......@@ -1662,7 +1650,7 @@ public class ContentViewCore implements
clearUserSelection();
}
}
updateNativeFocus();
if (mNativeContentViewCore != 0) nativeSetFocus(mNativeContentViewCore, gainFocus);
}
/**
......@@ -2622,16 +2610,14 @@ public class ContentViewCore implements
}
/**
* 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();
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment