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

Side by Side Diff: content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java

Issue 373523002: Send correct key-codes when doing composition events instead of always 0. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added some todo comments Created 6 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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.input; 5 package org.chromium.content.browser.input;
6 6
7 import android.os.SystemClock; 7 import android.os.SystemClock;
8 import android.text.Editable; 8 import android.text.Editable;
9 import android.text.InputType; 9 import android.text.InputType;
10 import android.text.Selection; 10 import android.text.Selection;
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 if (b < 0) b = 0; 453 if (b < 0) b = 0;
454 if (a > textLength) a = textLength; 454 if (a > textLength) a = textLength;
455 if (b > textLength) b = textLength; 455 if (b > textLength) b = textLength;
456 456
457 if (a == b) { 457 if (a == b) {
458 removeComposingSpans(mEditable); 458 removeComposingSpans(mEditable);
459 } else { 459 } else {
460 super.setComposingRegion(a, b); 460 super.setComposingRegion(a, b);
461 } 461 }
462 updateSelectionIfRequired(); 462 updateSelectionIfRequired();
463 return mImeAdapter.setComposingRegion(a, b); 463
464 CharSequence regionText = null;
465 if (b > a) {
466 regionText = mEditable.subSequence(start, end);
467 }
468 return mImeAdapter.setComposingRegion(regionText, a, b);
464 } 469 }
465 470
466 boolean isActive() { 471 boolean isActive() {
467 return getInputMethodManagerWrapper().isActive(mInternalView); 472 return getInputMethodManagerWrapper().isActive(mInternalView);
468 } 473 }
469 474
470 private InputMethodManagerWrapper getInputMethodManagerWrapper() { 475 private InputMethodManagerWrapper getInputMethodManagerWrapper() {
471 return mImeAdapter.getInputMethodManagerWrapper(); 476 return mImeAdapter.getInputMethodManagerWrapper();
472 } 477 }
473 478
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 @VisibleForTesting 524 @VisibleForTesting
520 ImeState getImeStateForTesting() { 525 ImeState getImeStateForTesting() {
521 String text = mEditable.toString(); 526 String text = mEditable.toString();
522 int selectionStart = Selection.getSelectionStart(mEditable); 527 int selectionStart = Selection.getSelectionStart(mEditable);
523 int selectionEnd = Selection.getSelectionEnd(mEditable); 528 int selectionEnd = Selection.getSelectionEnd(mEditable);
524 int compositionStart = getComposingSpanStart(mEditable); 529 int compositionStart = getComposingSpanStart(mEditable);
525 int compositionEnd = getComposingSpanEnd(mEditable); 530 int compositionEnd = getComposingSpanEnd(mEditable);
526 return new ImeState(text, selectionStart, selectionEnd, compositionStart , compositionEnd); 531 return new ImeState(text, selectionStart, selectionEnd, compositionStart , compositionEnd);
527 } 532 }
528 } 533 }
OLDNEW
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698