chromeos: Support IME system tray menus in mash
For go/mustash the ash system UI does not run in the chrome browser
process. Convert browser to ash communication for IMEs to use mojo.
Use mojo for both classic ash and mash so that we exercise the code
before mash ships.
Introduce ash ImeController mojo interface. Use ImeControllerClient
in chrome browser to observe InputMethodManager for IME changes and
push the data down to ash. This allows ash to synchronously query
the current and available IMEs when opening UI menus.
Declare the interface for ash ImeControllerClient, which will be used
in the next CL to handle IME switching via keyboard accelerators.
Bug: 724305
Test: added to ash_unittests and chrome unit_tests
Change-Id: I00e21078a519a706e2fe0ee8164b154f724abab2
Reviewed-on: https://chromium-review.googlesource.com/540015
Commit-Queue: James Cook <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Xiyuan Xia <[email protected]>
Cr-Commit-Position: refs/heads/master@{#480836}
diff --git a/ash/mojo_interface_factory.cc b/ash/mojo_interface_factory.cc
index b11a3f8..d7bd8295 100644
--- a/ash/mojo_interface_factory.cc
+++ b/ash/mojo_interface_factory.cc
@@ -9,6 +9,7 @@
#include "ash/accelerators/accelerator_controller.h"
#include "ash/cast_config_controller.h"
#include "ash/display/ash_display_controller.h"
+#include "ash/ime/ime_controller.h"
#include "ash/login/lock_screen_controller.h"
#include "ash/media_controller.h"
#include "ash/new_window_controller.h"
@@ -57,6 +58,12 @@
Shell::Get()->cast_config()->BindRequest(std::move(request));
}
+void BindImeControllerRequestOnMainThread(
+ const service_manager::BindSourceInfo& source_info,
+ mojom::ImeControllerRequest request) {
+ Shell::Get()->ime_controller()->BindRequest(std::move(request));
+}
+
void BindLocaleNotificationControllerOnMainThread(
const service_manager::BindSourceInfo& source_info,
mojom::LocaleNotificationControllerRequest request) {
@@ -148,6 +155,8 @@
main_thread_task_runner);
registry->AddInterface(base::Bind(&BindAppListRequestOnMainThread),
main_thread_task_runner);
+ registry->AddInterface(base::Bind(&BindImeControllerRequestOnMainThread),
+ main_thread_task_runner);
registry->AddInterface(
base::Bind(&BindAshDisplayControllerRequestOnMainThread),
main_thread_task_runner);