Commit 10fa9630 authored by Yuichiro Hanada's avatar Yuichiro Hanada Committed by Commit Bot

Implement ArcImeService::EnsureCaretNotInRect.

It's left as unimplemented because Android WM handles insets by VK for
most cases.
However, Android WM can't move the SystemTray up for inline-reply in an
Android notification because from Android WM's point of view,
notificaiton is placed at (0, 0).
This CL implements ArcImeService::EnsureCaretNotInRect to cover that
case.
This CL changes the behavior of windowed Android app with a11y keyboard.
Before this CL, a position of a window is not changed by a11y keyboard
visibility, but after this CL a position can be changed not to be
covered by a11y keyboard.

      SystemTray moves up if there is a space for it.

Bug: b/114115612
Test: manual - Focus on inline reply of an Android notificatioln and
Change-Id: Ib666b6c269a8fc36195d30affa4c7a8a805560d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1631859Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: default avatarTetsui Ohkubo <tetsui@chromium.org>
Commit-Queue: Yuichiro Hanada <yhanada@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664583}
parent 06cf1d55
......@@ -7,4 +7,5 @@ include_rules = [
"+ui/gfx/geometry",
# Revisit this dependency when crbug.com/890403 is resovled.
"+ui/views",
"+ui/wm",
]
......@@ -27,6 +27,7 @@
#include "ui/gfx/range/range.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/non_client_view.h"
#include "ui/wm/core/ime_util_chromeos.h"
namespace arc {
......@@ -451,6 +452,13 @@ bool ArcImeService::GetTextFromRange(const gfx::Range& range,
return true;
}
void ArcImeService::EnsureCaretNotInRect(const gfx::Rect& rect_in_screen) {
if (focused_arc_window_ == nullptr)
return;
aura::Window* top_level_window = focused_arc_window_->GetToplevelWindow();
wm::EnsureWindowNotInRect(top_level_window, rect_in_screen);
}
ui::TextInputMode ArcImeService::GetTextInputMode() const {
return ui::TEXT_INPUT_MODE_DEFAULT;
}
......
......@@ -116,6 +116,7 @@ class ArcImeService : public KeyedService,
bool GetEditableSelectionRange(gfx::Range* range) const override;
bool GetTextFromRange(const gfx::Range& range,
base::string16* text) const override;
void EnsureCaretNotInRect(const gfx::Rect& rect) override;
// Overridden from ui::TextInputClient (with default implementation):
// TODO(kinaba): Support each of these methods to the extent possible in
......@@ -135,7 +136,6 @@ class ArcImeService : public KeyedService,
bool ChangeTextDirectionAndLayoutAlignment(
base::i18n::TextDirection direction) override;
void ExtendSelectionAndDelete(size_t before, size_t after) override;
void EnsureCaretNotInRect(const gfx::Rect& rect) override {}
bool IsTextEditCommandEnabled(ui::TextEditCommand command) const override;
void SetTextEditCommandForNextKeyEvent(ui::TextEditCommand command) override {
}
......
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