Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(847)

Unified Diff: services/ui/ime/ime_server_impl.cc

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/ime/ime_server_impl.h ('k') | services/ui/ime/test_ime_driver/manifest.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « services/ui/ime/ime_server_impl.h ('k') | services/ui/ime/test_ime_driver/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698