Commit 6706df3f authored by Shu Chen's avatar Shu Chen Committed by Commit Bot

Removes the dead code of PlatformImeController and TextInputState.

Bug: 965908
Change-Id: Iaa18ea0308e189def61cee1cc460221d456bb7e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1627835
Commit-Queue: Shu Chen <shuchen@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666192}
parent d0e9cc87
......@@ -24,10 +24,8 @@
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/transform.h"
#include "ui/platform_window/platform_ime_controller.h"
#include "ui/platform_window/platform_window.h"
#include "ui/platform_window/platform_window_init_properties.h"
#include "ui/platform_window/text_input_state.h"
namespace ash {
......
......@@ -134,10 +134,6 @@ void DrmWindowHost::ConfineCursorToBounds(const gfx::Rect& bounds) {
cursor_->CommitBoundsChange(widget_, bounds_, bounds);
}
PlatformImeController* DrmWindowHost::GetPlatformImeController() {
return nullptr;
}
void DrmWindowHost::SetRestoredBoundsInPixels(const gfx::Rect& bounds) {
NOTREACHED();
}
......
......@@ -76,7 +76,6 @@ class DrmWindowHost : public PlatformWindow,
void SetCursor(PlatformCursor cursor) override;
void MoveCursorTo(const gfx::Point& location) override;
void ConfineCursorToBounds(const gfx::Rect& bounds) override;
PlatformImeController* GetPlatformImeController() override;
void SetRestoredBoundsInPixels(const gfx::Rect& bounds) override;
gfx::Rect GetRestoredBoundsInPixels() const override;
......
......@@ -150,11 +150,6 @@ void ScenicWindow::ConfineCursorToBounds(const gfx::Rect& bounds) {
NOTIMPLEMENTED();
}
PlatformImeController* ScenicWindow::GetPlatformImeController() {
NOTIMPLEMENTED();
return nullptr;
}
void ScenicWindow::SetRestoredBoundsInPixels(const gfx::Rect& bounds) {
NOTIMPLEMENTED();
}
......
......@@ -60,7 +60,6 @@ class OZONE_EXPORT ScenicWindow : public PlatformWindow,
void SetCursor(PlatformCursor cursor) override;
void MoveCursorTo(const gfx::Point& location) override;
void ConfineCursorToBounds(const gfx::Rect& bounds) override;
PlatformImeController* GetPlatformImeController() override;
void SetRestoredBoundsInPixels(const gfx::Rect& bounds) override;
gfx::Rect GetRestoredBoundsInPixels() const override;
......
......@@ -452,11 +452,6 @@ void WaylandWindow::ConfineCursorToBounds(const gfx::Rect& bounds) {
NOTIMPLEMENTED();
}
PlatformImeController* WaylandWindow::GetPlatformImeController() {
NOTIMPLEMENTED();
return nullptr;
}
void WaylandWindow::SetRestoredBoundsInPixels(const gfx::Rect& bounds) {
restored_bounds_ = bounds;
}
......
......@@ -121,7 +121,6 @@ class WaylandWindow : public PlatformWindow,
void SetCursor(PlatformCursor cursor) override;
void MoveCursorTo(const gfx::Point& location) override;
void ConfineCursorToBounds(const gfx::Rect& bounds) override;
PlatformImeController* GetPlatformImeController() override;
void SetRestoredBoundsInPixels(const gfx::Rect& bounds) override;
gfx::Rect GetRestoredBoundsInPixels() const override;
......
......@@ -6,19 +6,15 @@ import("//build/config/ui.gni")
source_set("platform_window") {
sources = [
"platform_ime_controller.h",
"platform_window.h",
"platform_window_delegate.h",
"platform_window_init_properties.cc",
"platform_window_init_properties.h",
"text_input_state.cc",
"text_input_state.h",
]
deps = [
"//base",
"//ui/base",
"//ui/base/ime:text_input_types",
"//ui/gfx",
]
......
// 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_PLATFORM_IME_CONTROLLER_H_
#define UI_PLATFORM_WINDOW_PLATFORM_IME_CONTROLLER_H_
#include "ui/platform_window/text_input_state.h"
namespace ui {
// Platform input method editor controller.
class PlatformImeController {
public:
virtual ~PlatformImeController() {}
// Update the text input state.
virtual void UpdateTextInputState(const TextInputState& state) = 0;
// Set visibility of input method editor UI (software keyboard, etc).
virtual void SetImeVisibility(bool visible) = 0;
};
} // namespace ui
#endif // UI_PLATFORM_WINDOW_PLATFORM_IME_CONTROLLER_H_
......@@ -19,8 +19,6 @@ class Rect;
namespace ui {
class PlatformImeController;
// Platform window.
//
// Each instance of PlatformWindow represents a single window in the
......@@ -64,10 +62,6 @@ class PlatformWindow : public PropertyHandler {
// is in platform window coordinates.
virtual void ConfineCursorToBounds(const gfx::Rect& bounds) = 0;
// The PlatformImeController is owned by the PlatformWindow, the ownership is
// not transferred.
virtual PlatformImeController* GetPlatformImeController() = 0;
// Sets and gets the restored bounds of the platform-window.
virtual void SetRestoredBoundsInPixels(const gfx::Rect& bounds) = 0;
virtual gfx::Rect GetRestoredBoundsInPixels() const = 0;
......
......@@ -70,10 +70,6 @@ void StubWindow::MoveCursorTo(const gfx::Point& location) {}
void StubWindow::ConfineCursorToBounds(const gfx::Rect& bounds) {}
PlatformImeController* StubWindow::GetPlatformImeController() {
return nullptr;
}
void StubWindow::SetRestoredBoundsInPixels(const gfx::Rect& bounds) {}
gfx::Rect StubWindow::GetRestoredBoundsInPixels() const {
......
......@@ -47,7 +47,6 @@ class STUB_WINDOW_EXPORT StubWindow : public PlatformWindow {
void SetCursor(PlatformCursor cursor) override;
void MoveCursorTo(const gfx::Point& location) override;
void ConfineCursorToBounds(const gfx::Rect& bounds) override;
PlatformImeController* GetPlatformImeController() override;
void SetRestoredBoundsInPixels(const gfx::Rect& bounds) override;
gfx::Rect GetRestoredBoundsInPixels() const override;
......
// 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/text_input_state.h"
namespace ui {
TextInputState::TextInputState()
: type(TEXT_INPUT_TYPE_NONE),
flags(TEXT_INPUT_FLAG_NONE),
selection_start(0),
selection_end(0),
composition_start(0),
composition_end(0),
can_compose_inline(false) {}
TextInputState::TextInputState(TextInputType type,
int flags,
const std::string& text,
int selection_start,
int selection_end,
int composition_start,
int composition_end,
bool can_compose_inline)
: type(type),
flags(flags),
text(text),
selection_start(selection_start),
selection_end(selection_end),
composition_start(composition_start),
composition_end(composition_end),
can_compose_inline(can_compose_inline) {}
TextInputState::TextInputState(const TextInputState& other) = default;
bool TextInputState::operator==(const TextInputState& other) const {
return type == other.type &&
flags == other.flags &&
text == other.text &&
selection_start == other.selection_start &&
selection_end == other.selection_end &&
composition_start == other.composition_start &&
composition_end == other.composition_end &&
can_compose_inline == other.can_compose_inline;
}
} // namespace ui
// 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_TEXT_INPUT_STATE_H_
#define UI_PLATFORM_WINDOW_TEXT_INPUT_STATE_H_
#include <string>
#include "ui/base/ime/text_input_flags.h"
#include "ui/base/ime/text_input_type.h"
namespace ui {
// Text input info which is based on blink::WebTextInputInfo.
struct TextInputState {
TextInputState();
TextInputState(TextInputType type,
int flags,
const std::string& text,
int selection_start,
int selection_end,
int composition_start,
int composition_end,
bool can_compose_inline);
TextInputState(const TextInputState& other);
bool operator==(const TextInputState& other) const;
// The type of input field.
TextInputType type;
// The flags of the input field (autocorrect, autocomplete, etc.).
int flags;
// The value of the input field.
std::string text;
// The cursor position of the current selection start, or the caret position
// if nothing is selected.
int selection_start;
// The cursor position of the current selection end, or the caret position
// if nothing is selected.
int selection_end;
// The start position of the current composition, or -1 if there is none.
int composition_start;
// The end position of the current composition, or -1 if there is none.
int composition_end;
// Whether or not inline composition can be performed for the current input.
bool can_compose_inline;
};
} // namespace ui
#endif // UI_PLATFORM_WINDOW_TEXT_INPUT_STATE_H_
......@@ -136,10 +136,6 @@ void WinWindow::MoveCursorTo(const gfx::Point& location) {
void WinWindow::ConfineCursorToBounds(const gfx::Rect& bounds) {
}
PlatformImeController* WinWindow::GetPlatformImeController() {
return nullptr;
}
void WinWindow::SetRestoredBoundsInPixels(const gfx::Rect& bounds) {}
gfx::Rect WinWindow::GetRestoredBoundsInPixels() const {
......
......@@ -46,7 +46,6 @@ class WIN_WINDOW_EXPORT WinWindow : public PlatformWindow,
void SetCursor(PlatformCursor cursor) override;
void MoveCursorTo(const gfx::Point& location) override;
void ConfineCursorToBounds(const gfx::Rect& bounds) override;
PlatformImeController* GetPlatformImeController() override;
void SetRestoredBoundsInPixels(const gfx::Rect& bounds) override;
gfx::Rect GetRestoredBoundsInPixels() const override;
......
......@@ -295,10 +295,6 @@ void X11WindowBase::ConfineCursorToBounds(const gfx::Rect& bounds) {
has_pointer_barriers_ = true;
}
PlatformImeController* X11WindowBase::GetPlatformImeController() {
return nullptr;
}
void X11WindowBase::SetRestoredBoundsInPixels(const gfx::Rect& bounds) {
// TODO: https://crbug.com/848131
NOTIMPLEMENTED();
......
......@@ -47,7 +47,6 @@ class X11_WINDOW_EXPORT X11WindowBase : public PlatformWindow {
PlatformWindowState GetPlatformWindowState() const override;
void MoveCursorTo(const gfx::Point& location) override;
void ConfineCursorToBounds(const gfx::Rect& bounds) override;
PlatformImeController* GetPlatformImeController() override;
void SetRestoredBoundsInPixels(const gfx::Rect& bounds) override;
gfx::Rect GetRestoredBoundsInPixels() const override;
......
......@@ -50,9 +50,6 @@ class FakePlatformWindow : public ui::PlatformWindow, public ui::WmDragHandler {
void SetCursor(ui::PlatformCursor cursor) override {}
void MoveCursorTo(const gfx::Point& location) override {}
void ConfineCursorToBounds(const gfx::Rect& bounds) override {}
ui::PlatformImeController* GetPlatformImeController() override {
return nullptr;
}
void SetRestoredBoundsInPixels(const gfx::Rect& bounds) override {}
gfx::Rect GetRestoredBoundsInPixels() const override { return gfx::Rect(); }
......
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