| Index: services/ui/ime/ime_server_impl.cc
|
| diff --git a/services/ui/ime/ime_server_impl.cc b/services/ui/ime/ime_server_impl.cc
|
| index ee3de92d827973648a8044487b192d814f243bfd..058ab7aec71b35ef551ea32546160dcbec84449c 100644
|
| --- a/services/ui/ime/ime_server_impl.cc
|
| +++ b/services/ui/ime/ime_server_impl.cc
|
| @@ -14,9 +14,11 @@ IMEServerImpl::IMEServerImpl() : current_id_(0) {}
|
| IMEServerImpl::~IMEServerImpl() {}
|
|
|
| void IMEServerImpl::Init(service_manager::Connector* connector) {
|
| - // TODO(moshayedi): crbug.com/641041. Look up the driver from the mojo:catalog
|
| - // service.
|
| - connector->Connect("service:test_ime_driver");
|
| + connector_ = connector;
|
| + connector_->ConnectToInterface("service:catalog", &catalog_);
|
| + catalog_->GetEntriesProvidingCapability(
|
| + "ime:ime_driver",
|
| + base::Bind(&IMEServerImpl::OnGotCatalogEntries, base::Unretained(this)));
|
| }
|
|
|
| void IMEServerImpl::AddBinding(mojom::IMEServerRequest request) {
|
| @@ -50,4 +52,13 @@ void IMEServerImpl::StartSession(
|
| }
|
| }
|
|
|
| +void IMEServerImpl::OnGotCatalogEntries(
|
| + std::vector<catalog::mojom::EntryPtr> entries) {
|
| + // TODO(moshayedi): crbug.com/662157. Decide what to do when number of
|
| + // available IME drivers isn't exactly one.
|
| + if (entries.size() == 0)
|
| + return;
|
| + connector_->Connect((*entries.begin())->name);
|
| +}
|
| +
|
| } // namespace ui
|
|
|