Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.content.browser; | 5 package org.chromium.content.browser; |
| 6 | 6 |
| 7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
| 8 import android.app.Activity; | 8 import android.app.Activity; |
| 9 import android.app.SearchManager; | 9 import android.app.SearchManager; |
| 10 import android.content.ClipboardManager; | 10 import android.content.ClipboardManager; |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 650 getContentViewClient().onImeEvent(); | 650 getContentViewClient().onImeEvent(); |
| 651 if (mFocusedNodeEditable) dismissTextHandles(); | 651 if (mFocusedNodeEditable) dismissTextHandles(); |
| 652 } | 652 } |
| 653 | 653 |
| 654 @Override | 654 @Override |
| 655 public void onDismissInput() { | 655 public void onDismissInput() { |
| 656 getContentViewClient().onImeStateChangeRequested(false); | 656 getContentViewClient().onImeStateChangeRequested(false); |
| 657 } | 657 } |
| 658 | 658 |
| 659 @Override | 659 @Override |
| 660 public void onKeyboardBoundsUnchanged() { | |
| 661 assert mWebContents != null; | |
| 662 mWebContents.scrollFocusedEditableNodeIntoView(); | |
| 663 } | |
| 664 | |
| 665 @Override | |
| 660 public View getAttachedView() { | 666 public View getAttachedView() { |
| 661 return mContainerView; | 667 return mContainerView; |
| 662 } | 668 } |
| 663 | 669 |
| 664 @Override | 670 @Override |
| 665 public ResultReceiver getNewShowKeyboardReceiver() { | 671 public ResultReceiver getNewShowKeyboardReceiver() { |
| 666 return new ResultReceiver(new Handler()) { | 672 return new ResultReceiver(new Handler()) { |
| 667 @Override | 673 @Override |
| 668 public void onReceiveResult(int resultCode, Bundle r esultData) { | 674 public void onReceiveResult(int resultCode, Bundle r esultData) { |
| 669 getContentViewClient().onImeStateChangeRequested ( | 675 getContentViewClient().onImeStateChangeRequested ( |
| (...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1557 | 1563 |
| 1558 // Execute a delayed form focus operation because the OSK was brought | 1564 // Execute a delayed form focus operation because the OSK was brought |
| 1559 // up earlier. | 1565 // up earlier. |
| 1560 if (!mFocusPreOSKViewportRect.isEmpty()) { | 1566 if (!mFocusPreOSKViewportRect.isEmpty()) { |
| 1561 Rect rect = new Rect(); | 1567 Rect rect = new Rect(); |
| 1562 getContainerView().getWindowVisibleDisplayFrame(rect); | 1568 getContainerView().getWindowVisibleDisplayFrame(rect); |
| 1563 if (!rect.equals(mFocusPreOSKViewportRect)) { | 1569 if (!rect.equals(mFocusPreOSKViewportRect)) { |
| 1564 // Only assume the OSK triggered the onSizeChanged if width was preserved. | 1570 // Only assume the OSK triggered the onSizeChanged if width was preserved. |
| 1565 if (rect.width() == mFocusPreOSKViewportRect.width()) { | 1571 if (rect.width() == mFocusPreOSKViewportRect.width()) { |
| 1566 assert mWebContents != null; | 1572 assert mWebContents != null; |
| 1567 mWebContents.scrollFocusedEditableNodeIntoView(); | 1573 mWebContents.scrollFocusedEditableNodeIntoView(); |
|
jdduke (slow)
2015/01/14 22:59:51
Do we still need this logic?
please use gerrit instead
2015/01/14 23:09:27
This logic scrolls the focused element into view a
| |
| 1568 } | 1574 } |
| 1569 cancelRequestToScrollFocusedEditableNodeIntoView(); | 1575 cancelRequestToScrollFocusedEditableNodeIntoView(); |
| 1570 } | 1576 } |
| 1571 } | 1577 } |
| 1572 } | 1578 } |
| 1573 | 1579 |
| 1574 private void cancelRequestToScrollFocusedEditableNodeIntoView() { | 1580 private void cancelRequestToScrollFocusedEditableNodeIntoView() { |
| 1575 // Zero-ing the rect will prevent |updateAfterSizeChanged()| from | 1581 // Zero-ing the rect will prevent |updateAfterSizeChanged()| from |
| 1576 // issuing the delayed form focus event. | 1582 // issuing the delayed form focus event. |
| 1577 mFocusPreOSKViewportRect.setEmpty(); | 1583 mFocusPreOSKViewportRect.setEmpty(); |
| (...skipping 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3138 private native void nativeWasResized(long nativeContentViewCoreImpl); | 3144 private native void nativeWasResized(long nativeContentViewCoreImpl); |
| 3139 | 3145 |
| 3140 private native void nativeSetAccessibilityEnabled( | 3146 private native void nativeSetAccessibilityEnabled( |
| 3141 long nativeContentViewCoreImpl, boolean enabled); | 3147 long nativeContentViewCoreImpl, boolean enabled); |
| 3142 | 3148 |
| 3143 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp l, | 3149 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp l, |
| 3144 int x, int y, int w, int h); | 3150 int x, int y, int w, int h); |
| 3145 | 3151 |
| 3146 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl , boolean opaque); | 3152 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl , boolean opaque); |
| 3147 } | 3153 } |
| OLD | NEW |