Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Issue 1177483003: Revert of Change focus status according to the change of window focus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698