Commit 6700540d authored by Shu Chen's avatar Shu Chen Committed by Commit Bot

Reland "Removes ui/platform_window/mojo as it is not used by anyone."

This is a reland of 6eb61402

Original change's description:
> Removes ui/platform_window/mojo as it is not used by anyone.
> 
> This is to remove the ref to some types under ui/base/ime/mojo, which will be removed later.
> 
> Bug: 965908
> Change-Id: I7979524066104c829b4f4e287a0ab87c9365f124
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1626055
> Reviewed-by: Dominick Ng <dominickn@chromium.org>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Commit-Queue: Shu Chen <shuchen@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#662924}

Bug: 965908
Change-Id: I6bb1c6d081ce235c959cc30e53d20b57dd0e1459
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1626841Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Shu Chen <shuchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#663381}
parent 69adb3bd
...@@ -1406,7 +1406,6 @@ component("ash") { ...@@ -1406,7 +1406,6 @@ component("ash") {
"//ui/native_theme", "//ui/native_theme",
"//ui/ozone", "//ui/ozone",
"//ui/platform_window", "//ui/platform_window",
"//ui/platform_window/mojo",
"//ui/platform_window/stub", "//ui/platform_window/stub",
"//ui/snapshot", "//ui/snapshot",
"//ui/views/window/vector_icons", "//ui/views/window/vector_icons",
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "ui/gfx/geometry/rect_conversions.h" #include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/rect_f.h" #include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/transform.h" #include "ui/gfx/transform.h"
#include "ui/platform_window/mojo/ime_type_converters.h"
#include "ui/platform_window/platform_ime_controller.h" #include "ui/platform_window/platform_ime_controller.h"
#include "ui/platform_window/platform_window.h" #include "ui/platform_window/platform_window.h"
#include "ui/platform_window/platform_window_init_properties.h" #include "ui/platform_window/platform_window_init_properties.h"
......
...@@ -13,7 +13,6 @@ import "ui/events/mojo/event.mojom"; ...@@ -13,7 +13,6 @@ import "ui/events/mojo/event.mojom";
import "ui/gfx/geometry/mojo/geometry.mojom"; import "ui/gfx/geometry/mojo/geometry.mojom";
import "ui/gfx/mojo/ca_layer_params.mojom"; import "ui/gfx/mojo/ca_layer_params.mojom";
import "ui/gfx/range/mojo/range.mojom"; import "ui/gfx/range/mojo/range.mojom";
import "ui/platform_window/mojo/text_input_state.mojom";
// The interface through which code in the browser process, in // The interface through which code in the browser process, in
// RenderWidgetHostViewMac, sends messages to the app shim process, targeting // RenderWidgetHostViewMac, sends messages to the app shim process, targeting
......
...@@ -22,7 +22,6 @@ mojom("mojom") { ...@@ -22,7 +22,6 @@ mojom("mojom") {
"//mojo/public/mojom/base", "//mojo/public/mojom/base",
"//ui/gfx/geometry/mojo", "//ui/gfx/geometry/mojo",
"//ui/gfx/mojo", "//ui/gfx/mojo",
"//ui/platform_window/mojo:interfaces",
] ]
if (is_chromeos) { if (is_chromeos) {
......
...@@ -126,7 +126,6 @@ jumbo_component("aura") { ...@@ -126,7 +126,6 @@ jumbo_component("aura") {
"//ui/gfx/geometry", "//ui/gfx/geometry",
"//ui/gl", "//ui/gl",
"//ui/platform_window", "//ui/platform_window",
"//ui/platform_window/mojo",
"//ui/platform_window/stub", "//ui/platform_window/stub",
] ]
......
# Copyright 2015 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/jumbo.gni")
import("//mojo/public/tools/bindings/mojom.gni")
# This target does NOT depend on skia. One can depend on this target to avoid
# picking up a dependency on skia.
jumbo_component("mojo") {
output_name = "mojo_ime_lib"
public_deps = [
"//ui/base/ime",
]
deps = [
":interfaces",
"//base",
"//ui/platform_window",
]
defines = [ "MOJO_IME_IMPLEMENTATION" ]
sources = [
"ime_type_converters.cc",
"ime_type_converters.h",
"mojo_ime_export.h",
]
}
mojom("interfaces") {
sources = [
"text_input_state.mojom",
]
public_deps = [
"//ui/base/ime/mojo",
]
}
include_rules = [
"+ui/base/ime/text_input_flags.h",
"+ui/base/ime/text_input_type.h",
"+ui/platform_window/text_input_state.h",
]
per-file *_type_converter*.*=set noparent
per-file *_type_converter*.*=file://ipc/SECURITY_OWNERS
per-file *.mojom=set noparent
per-file *.mojom=file://ipc/SECURITY_OWNERS
// Copyright 2015 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.
#include "ui/platform_window/mojo/ime_type_converters.h"
#include <stdint.h>
#include "base/macros.h"
namespace mojo {
#define TEXT_INPUT_TYPE_ASSERT(NAME) \
static_assert(static_cast<int32_t>(ui::mojom::TextInputType::NAME) == \
static_cast<int32_t>(ui::TEXT_INPUT_TYPE_##NAME), \
"TEXT_INPUT_TYPE must match")
TEXT_INPUT_TYPE_ASSERT(NONE);
TEXT_INPUT_TYPE_ASSERT(TEXT);
TEXT_INPUT_TYPE_ASSERT(PASSWORD);
TEXT_INPUT_TYPE_ASSERT(SEARCH);
TEXT_INPUT_TYPE_ASSERT(EMAIL);
TEXT_INPUT_TYPE_ASSERT(NUMBER);
TEXT_INPUT_TYPE_ASSERT(TELEPHONE);
TEXT_INPUT_TYPE_ASSERT(URL);
TEXT_INPUT_TYPE_ASSERT(DATE);
TEXT_INPUT_TYPE_ASSERT(DATE_TIME);
TEXT_INPUT_TYPE_ASSERT(DATE_TIME_LOCAL);
TEXT_INPUT_TYPE_ASSERT(MONTH);
TEXT_INPUT_TYPE_ASSERT(TIME);
TEXT_INPUT_TYPE_ASSERT(WEEK);
TEXT_INPUT_TYPE_ASSERT(TEXT_AREA);
TEXT_INPUT_TYPE_ASSERT(CONTENT_EDITABLE);
TEXT_INPUT_TYPE_ASSERT(DATE_TIME_FIELD);
TEXT_INPUT_TYPE_ASSERT(MAX);
#define TEXT_INPUT_FLAG_ASSERT(NAME) \
static_assert(static_cast<int32_t>(ui::mojom::TextInputFlag::NAME) == \
static_cast<int32_t>(ui::TEXT_INPUT_FLAG_##NAME), \
"TEXT_INPUT_FLAG must match")
TEXT_INPUT_FLAG_ASSERT(NONE);
TEXT_INPUT_FLAG_ASSERT(AUTOCOMPLETE_ON);
TEXT_INPUT_FLAG_ASSERT(AUTOCOMPLETE_OFF);
TEXT_INPUT_FLAG_ASSERT(AUTOCORRECT_ON);
TEXT_INPUT_FLAG_ASSERT(AUTOCORRECT_OFF);
TEXT_INPUT_FLAG_ASSERT(SPELLCHECK_ON);
TEXT_INPUT_FLAG_ASSERT(SPELLCHECK_OFF);
TEXT_INPUT_FLAG_ASSERT(AUTOCAPITALIZE_NONE);
TEXT_INPUT_FLAG_ASSERT(AUTOCAPITALIZE_CHARACTERS);
TEXT_INPUT_FLAG_ASSERT(AUTOCAPITALIZE_WORDS);
TEXT_INPUT_FLAG_ASSERT(AUTOCAPITALIZE_SENTENCES);
// static
ui::TextInputState
TypeConverter<ui::TextInputState, ui::mojom::TextInputStatePtr>::Convert(
const ui::mojom::TextInputStatePtr& input) {
return ui::TextInputState(
ConvertTo<ui::TextInputType>(input->type), input->flags,
input->text.has_value() ? input->text.value() : std::string(),
input->selection_start, input->selection_end, input->composition_start,
input->composition_end, input->can_compose_inline);
}
} // namespace mojo
// Copyright 2015 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.
#ifndef UI_PLATFORM_WINDOW_MOJO_IME_TYPE_CONVERTERS_H_
#define UI_PLATFORM_WINDOW_MOJO_IME_TYPE_CONVERTERS_H_
#include "ui/base/ime/ime_text_span.h"
#include "ui/platform_window/mojo/mojo_ime_export.h"
#include "ui/platform_window/mojo/text_input_state.mojom.h"
#include "ui/platform_window/text_input_state.h"
namespace mojo {
template <>
struct MOJO_IME_EXPORT
TypeConverter<ui::TextInputState, ui::mojom::TextInputStatePtr> {
static ui::TextInputState Convert(const ui::mojom::TextInputStatePtr& input);
};
} // namespace mojo
#endif // UI_PLATFORM_WINDOW_MOJO_IME_TYPE_CONVERTERS_H_
// Copyright 2015 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.
#ifndef UI_PLATFORM_WINDOW_MOJO_MOJO_IME_EXPORT_H_
#define UI_PLATFORM_WINDOW_MOJO_MOJO_IME_EXPORT_H_
#if defined(COMPONENT_BUILD)
#if defined(WIN32)
#if defined(MOJO_IME_IMPLEMENTATION)
#define MOJO_IME_EXPORT __declspec(dllexport)
#else
#define MOJO_IME_EXPORT __declspec(dllimport)
#endif
#else // !defined(WIN32)
#if defined(MOJO_IME_IMPLEMENTATION)
#define MOJO_IME_EXPORT __attribute__((visibility("default")))
#else
#define MOJO_IME_EXPORT
#endif
#endif // defined(WIN32)
#else // !defined(COMPONENT_BUILD)
#define MOJO_IME_EXPORT
#endif
#endif // UI_PLATFORM_WINDOW_MOJO_MOJO_IME_EXPORT_H_
// Copyright 2015 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.
module ui.mojom;
import "ui/base/ime/mojo/ime_types.mojom";
// Text input info which is based on blink::WebTextInputInfo.
struct TextInputState {
// The type of input field.
TextInputType type;
// The flags of the input field (autocorrect, autocomplete, etc.).
int32 flags;
// The value of the input field.
string? text;
// The cursor position of the current selection start, or the caret position
// if nothing is selected.
int32 selection_start;
// The cursor position of the current selection end, or the caret position
// if nothing is selected.
int32 selection_end;
// The start position of the current composition, or -1 if there is none.
int32 composition_start;
// The end position of the current composition, or -1 if there is none.
int32 composition_end;
// Whether or not inline composition can be performed for the current input.
bool can_compose_inline;
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment