• changwan's avatar
    Move call path for resetInputMethod · 2418e1b6
    changwan authored
    This is mostly about mechanical changes such as:
    
    - Move InputMethodController-related logic inside InputMethodController
      and call it first - such that we can expand the logic there.
    - Rename method name for better readability.
    
    Also, there are subtle logical changes:
    
    1) Try finishComposingText() even when the current input type is NONE.
       This should not have any effect.
    
    2) When finishComposingText() returns false, we no longer call
       UpdateTextInputState(). This should not have any effect.
    
    3) When finishComposingText() returns false, we no long call
       UpdateCompositionInfo(). This is used by Android and Mac.
       Previously, there was a chance that we propagate InvalidRange() all the
       way up to the keyboard app. Now ShouldUpdateCompositionInfo() returns
       false to make it clear.
    
    This is originally found in resolving crbug.com/664317, but is also
    needed for crbug.com/630137 because if we no longer cancel composition
    on selection change, then WebViewTest may fail because it uses
    TestWebViewClient which does not implement resetInputMethod().
    
    BUG=664317, 630137
    
    Review-Url: https://codereview.chromium.org/2561543003
    Cr-Commit-Position: refs/heads/master@{#437854}
    2418e1b6
ChromeClientImpl.h 10.2 KB