Chromium Code Reviews| 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 aebda91e321f592e556799e3420e4d064a3ef890..753f37c4bde6808219f064cc059461d6f60704f0 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 |
| @@ -521,9 +521,7 @@ public class ContentViewCore |
| new ImeAdapter.ImeAdapterDelegate() { |
| @Override |
| public void onImeEvent() { |
| - if (mPopupZoomer.isShowing()) { |
| - mPopupZoomer.hide(true); |
| - } |
| + mPopupZoomer.hide(true); |
| getContentViewClient().onImeEvent(); |
| hideTextHandles(); |
| } |
| @@ -754,6 +752,11 @@ public class ContentViewCore |
| mPopupZoomer.setOnTapListener(listener); |
| } |
| + @VisibleForTesting |
| + public void setPopupZoomerForTest(PopupZoomer popupZoomer) { |
| + mPopupZoomer = popupZoomer; |
| + } |
| + |
| /** |
| * Destroy the internal state of the ContentView. This method may only be |
| * called after the ContentView has been removed from the view system. No |
| @@ -1442,6 +1445,7 @@ public class ContentViewCore |
| hidePastePopup(); |
| hideSelectPopup(); |
| hideTextHandles(); |
| + mPopupZoomer.hide(false); |
| } |
| public void hideSelectActionBar() { |
| @@ -1636,7 +1640,10 @@ public class ContentViewCore |
| * @see View#onWindowFocusChanged(boolean) |
| */ |
| public void onWindowFocusChanged(boolean hasWindowFocus) { |
| - if (!hasWindowFocus) resetGestureDetection(); |
| + if (!hasWindowFocus) { |
| + resetGestureDetection(); |
| + mPopupZoomer.hide(false); |
|
jdduke (slow)
2014/08/21 14:46:41
When is this method called (without onHide also be
raghu
2014/08/21 16:12:32
Acknowledged. Its not necessary after hiding the z
|
| + } |
| } |
| public void onFocusChanged(boolean gainFocus) { |
| @@ -1645,6 +1652,7 @@ public class ContentViewCore |
| cancelRequestToScrollFocusedEditableNodeIntoView(); |
| hidePastePopup(); |
| hideTextHandles(); |
| + mPopupZoomer.hide(false); |
|
jdduke (slow)
2014/08/21 14:46:41
Just curious, is this a source of bugs? Is there h
raghu
2014/08/21 16:12:32
I didnt see any harm in keeping it visible, but I
|
| } |
| if (mNativeContentViewCore != 0) nativeSetFocus(mNativeContentViewCore, gainFocus); |
| } |
| @@ -1653,7 +1661,7 @@ public class ContentViewCore |
| * @see View#onKeyUp(int, KeyEvent) |
| */ |
| public boolean onKeyUp(int keyCode, KeyEvent event) { |
| - if (mPopupZoomer.isShowing() && keyCode == KeyEvent.KEYCODE_BACK) { |
| + if (keyCode == KeyEvent.KEYCODE_BACK) { |
|
jdduke (slow)
2014/08/21 14:46:41
Actually, this isn't quite right, as now we'll nev
raghu
2014/08/21 16:12:32
Done. It was a mistake to overlook the return stat
|
| mPopupZoomer.hide(true); |
| return true; |
| } |