ozone/wayland: set input method factory only upon CreateInputMethod

When tests are initialized, some of them try to set a test input
method factory. However, they fail to do so, because
OzonePlatform::InitializeUi is called earlier. That method does
various initialization and also sets the input method factory.

Previously, we used to set the factory in CreateInputMethod method
if that hasn't been set yet. (see https://crrev.com/c/1531600),
but after https://crrev.com/c/1798263, that functionality was
moved back to InitializeUi. We didn't run any tests with Wayland
and couldn't spot this problem. However, now, I'm enabling
views_unittests, and that problem was hit.

Thus, to fix the issue, let the GtkUi call CreateInputMethod to
give an OzonePlatform chance to set an input method. If it is
not set, then use gtkui provided one.

Bug: 578890
Change-Id: Ic09de5a18a1ff969e1a96977a987f09cac1129f5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2062974
Reviewed-by: Robert Kroeger <rjkroege@chromium.org>
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Maksim Sisov <msisov@igalia.com>
Cr-Commit-Position: refs/heads/master@{#742691}
2 files changed