Lacros: Supports SetInputType extension API.
Wayland has a similar concept to SetInputType with content_purpose
and content_hint However, they are not enough to represent the state
that Chrome needs. Thus, this CL introduces a new extension API to
proxy TextInputType, TextInputMode and TextInputFlags as is, so that
either side can agree what needs to be done without regression.
BUG=1269642
TEST=Ran locally.
Change-Id: Ie93634f5259094f94799921ba17d1184302e7213
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3593721
Reviewed-by: Darren Shen <[email protected]>
Reviewed-by: Mitsuru Oshima <[email protected]>
Reviewed-by: Yuichiro Hanada <[email protected]>
Reviewed-by: Robert Kroeger <[email protected]>
Reviewed-by: Sadrul Chowdhury <[email protected]>
Commit-Queue: Hidehiko Abe <[email protected]>
Cr-Commit-Position: refs/heads/main@{#996258}
diff --git a/ui/base/wayland/BUILD.gn b/ui/base/wayland/BUILD.gn
new file mode 100644
index 0000000..b2d3f8c
--- /dev/null
+++ b/ui/base/wayland/BUILD.gn
@@ -0,0 +1,70 @@
+# Copyright 2022 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//build/config/chromeos/ui_mode.gni")
+import("//build/config/ozone.gni")
+
+# ash-chrome depends on wayland, since components/exo is wayland compositor.
+# If platform supports wayland (as a client), it also depends on wayland.
+assert(is_chromeos_ash || ozone_platform_wayland)
+
+source_set("wayland_input_types_impl") {
+ sources = [ "wayland_input_types_impl.h" ]
+
+ visibility = [
+ ":wayland_client_input_types",
+ ":wayland_server_input_types",
+ ]
+}
+
+source_set("wayland_client_input_types") {
+ sources = [
+ "wayland_client_input_types.cc",
+ "wayland_client_input_types.h",
+ ]
+
+ public_deps = [
+ "//third_party/wayland-protocols:text_input_extension_protocol",
+ "//third_party/wayland-protocols:text_input_protocol",
+ "//third_party/wayland:wayland_client",
+ "//ui/base/ime:text_input_types",
+ ]
+
+ deps = [
+ ":wayland_input_types_impl",
+ "//base",
+ ]
+}
+
+source_set("wayland_server_input_types") {
+ sources = [
+ "wayland_server_input_types.cc",
+ "wayland_server_input_types.h",
+ ]
+
+ public_deps = [
+ "//third_party/abseil-cpp:absl",
+ "//third_party/wayland-protocols:text_input_extension_protocol",
+ "//third_party/wayland-protocols:text_input_protocol",
+ "//third_party/wayland:wayland_server",
+ "//ui/base/ime:text_input_types",
+ ]
+
+ deps = [
+ ":wayland_input_types_impl",
+ ]
+}
+
+source_set("unittests") {
+ testonly = true
+
+ sources = [ "wayland_input_types_unittest.cc" ]
+
+ deps = [
+ ":wayland_client_input_types",
+ ":wayland_server_input_types",
+ "//testing/gtest",
+ "//ui/base/ime:text_input_types",
+ ]
+}