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

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

Issue 2626983003: IME for Mus: Send TextInputClient information to IMEDriver. (Closed)
Patch Set: . Created 3 years, 11 months 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
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 0731d02a996b1a8e04aa8bd5603db25b9430b472..363737f49aacca116d2e312d86e7c5b32e134437 100644
--- a/services/ui/ime/ime_server_impl.cc
+++ b/services/ui/ime/ime_server_impl.cc
@@ -4,6 +4,7 @@
#include "services/ui/ime/ime_server_impl.h"
+#include "base/memory/ptr_util.h"
#include "services/catalog/public/interfaces/constants.mojom.h"
#include "services/service_manager/public/cpp/connector.h"
#include "services/ui/ime/ime_registrar_impl.h"
@@ -46,14 +47,16 @@ void IMEServerImpl::OnDriverChanged(mojom::IMEDriverPtr driver) {
driver_ = std::move(driver);
while (!pending_requests_.empty()) {
- driver_->StartSession(current_id_++,
- std::move(pending_requests_.front().first),
- std::move(pending_requests_.front().second));
+ driver_->StartSession(
+ current_id_++, std::move(pending_requests_.front()->client_info),
+ std::move(pending_requests_.front()->client),
+ std::move(pending_requests_.front()->input_method_request));
pending_requests_.pop();
}
}
void IMEServerImpl::StartSession(
+ mojom::TextInputClientInformationPtr client_info,
mojom::TextInputClientPtr client,
mojom::InputMethodRequest input_method_request) {
if (driver_.get()) {
@@ -61,11 +64,12 @@ void IMEServerImpl::StartSession(
// clients to the driver as they are. We may need to check |caret_bounds|
// parameter of InputMethod::OnCaretBoundsChanged() here and limit them to
// client's focused window.
- driver_->StartSession(current_id_++, std::move(client),
- std::move(input_method_request));
+ driver_->StartSession(current_id_++, std::move(client_info),
+ std::move(client), std::move(input_method_request));
} else {
- pending_requests_.push(
- std::make_pair(std::move(client), std::move(input_method_request)));
+ pending_requests_.push(base::MakeUnique<IMEServerImpl::PendingRequest>(
+ std::move(client_info), std::move(client),
+ std::move(input_method_request)));
}
}
@@ -78,4 +82,14 @@ void IMEServerImpl::OnGotCatalogEntries(
connector_->Connect((*entries.begin())->name);
}
+IMEServerImpl::PendingRequest::PendingRequest(
+ mojom::TextInputClientInformationPtr client_info,
+ mojom::TextInputClientPtr client,
+ mojom::InputMethodRequest input_method_request)
+ : client_info(std::move(client_info)),
+ client(std::move(client)),
+ input_method_request(std::move(input_method_request)) {}
+
+IMEServerImpl::PendingRequest::~PendingRequest() {}
+
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698