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

Unified Diff: ui/views/controls/textfield/textfield.cc

Issue 2553603002: New accessibility virtual keyboard behavior in non-sticky mode. (Closed)
Patch Set: rebase Created 3 years, 7 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
« no previous file with comments | « ui/keyboard/keyboard_ui.cc ('k') | ui/views/controls/textfield/textfield_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield.cc
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index f5ef65269e11f80687abc31429251104f2a5cba5..a826d107ddc7137b3b64852404cc99b6c889c2b8 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -7,12 +7,15 @@
#include <string>
#include <utility>
+#include "base/command_line.h"
#include "base/memory/ptr_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "ui/accessibility/ax_action_data.h"
#include "ui/accessibility/ax_node_data.h"
+#include "ui/aura/client/aura_constants.h"
+#include "ui/aura/window.h"
#include "ui/base/clipboard/scoped_clipboard_writer.h"
#include "ui/base/cursor/cursor.h"
#include "ui/base/default_style.h"
@@ -21,6 +24,7 @@
#include "ui/base/ime/text_edit_commands.h"
#include "ui/base/material_design/material_design_controller.h"
#include "ui/base/resource/resource_bundle.h"
+#include "ui/base/ui_base_switches.h"
#include "ui/base/ui_base_switches_util.h"
#include "ui/compositor/canvas_painter.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
@@ -47,6 +51,7 @@
#include "ui/views/style/platform_style.h"
#include "ui/views/views_delegate.h"
#include "ui/views/widget/widget.h"
+#include "ui/wm/core/coordinate_conversion.h"
#if defined(OS_WIN)
#include "base/win/win_util.h"
@@ -63,6 +68,10 @@
#include "ui/base/x/x11_util_internal.h" // nogncheck
#endif
+#if defined(OS_CHROMEOS)
+#include "ui/wm/core/ime_util_chromeos.h"
+#endif
+
namespace views {
namespace {
@@ -1013,8 +1022,13 @@ void Textfield::OnFocus() {
void Textfield::OnBlur() {
gfx::RenderText* render_text = GetRenderText();
render_text->set_focused(false);
- if (GetInputMethod())
+ if (GetInputMethod()) {
GetInputMethod()->DetachTextInputClient(this);
+#if defined(OS_CHROMEOS)
+ wm::RestoreWindowBoundsOnClientFocusLost(
+ GetNativeView()->GetToplevelWindow());
+#endif // defined(OS_CHROMEOS)
+ }
StopBlinkingCursor();
cursor_view_.SetVisible(false);
@@ -1485,7 +1499,12 @@ void Textfield::ExtendSelectionAndDelete(size_t before, size_t after) {
DeleteRange(range);
}
-void Textfield::EnsureCaretNotInRect(const gfx::Rect& rect) {}
+void Textfield::EnsureCaretNotInRect(const gfx::Rect& rect_in_screen) {
+#if defined(OS_CHROMEOS)
+ aura::Window* top_level_window = GetNativeView()->GetToplevelWindow();
+ wm::EnsureWindowNotInRect(top_level_window, rect_in_screen);
+#endif // defined(OS_CHROMEOS)
+}
bool Textfield::IsTextEditCommandEnabled(ui::TextEditCommand command) const {
base::string16 result;
« no previous file with comments | « ui/keyboard/keyboard_ui.cc ('k') | ui/views/controls/textfield/textfield_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698