• Changwan Ryu's avatar
    Support IME for multi-display in Chrome · 707d8cc3
    Changwan Ryu authored
    Currently, Chrome uses application context when it creates
    ContentView because it needs to reparent the view across different
    activities.
    
    Since it is not using activity context, and it seems quite challenging
    to refactor the codebase to do so, we are landing this as a short term
    workaround. The workaround consists of the following:
    
    1) Pass WindowAndroid into IMMWI, and try to get activity context, only
       for Chrome.
    2) Call setLocalFocus(true, true) only for showing keyboard.
       (jinsukkim@'s idea)
    3) Wait for input connection to be established
       (yukawa@'s idea)
    
    The rest are just plumbing work.
    
    Manually tested the following on physical device and emulator:
    
    1) activate IMEs between omnibox and content
    2) activate and deactivate IMEs by touching inside and outside input
       box
    3) move ChromePublic between displays and activate IMEs
    
    Also, manually tested that this works on WebView.
    
    Bug: 1021403
    
    Change-Id: Ia952f76e2fb1afef073825435ab4569bcded6762
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1994393
    Commit-Queue: Changwan Ryu <changwan@chromium.org>
    Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
    Reviewed-by: default avatarYohei Yukawa <yukawa@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#737537}
    707d8cc3
BUILD.gn 32.2 KB