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

Unified Diff: ui/views/accessibility/native_view_accessibility_base.cc

Issue 2955073002: Manky attempt with TextInputClient
Patch Set: Created 3 years, 6 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/views/accessibility/native_view_accessibility_base.h ('k') | ui/views/cocoa/bridged_content_view.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/accessibility/native_view_accessibility_base.cc
diff --git a/ui/views/accessibility/native_view_accessibility_base.cc b/ui/views/accessibility/native_view_accessibility_base.cc
index 49a06e54118e4c81f55d97c210fd9aa0efbacfd2..2840a9ef0e96bf1d5993b1a08982a779d0d1366b 100644
--- a/ui/views/accessibility/native_view_accessibility_base.cc
+++ b/ui/views/accessibility/native_view_accessibility_base.cc
@@ -6,6 +6,7 @@
#include "base/memory/ptr_util.h"
#include "base/strings/utf_string_conversions.h"
+#include "ui/base/ime/input_method.h"
#include "ui/events/event_utils.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/views/controls/native/native_view_host.h"
@@ -148,6 +149,15 @@ gfx::Rect NativeViewAccessibilityBase::GetScreenBoundsRect() const {
return view_->GetBoundsInScreen();
}
+ui::TextInputClient* NativeViewAccessibilityBase::GetTextInputClient() const {
+ if (ui::InputMethod* input_method = view_->GetInputMethod()) {
+ // This will return the wrong thing if a text field has focus, but a request
+ // comes in for some other view.
+ return input_method->GetTextInputClient();
+ }
+ return nullptr;
+}
+
gfx::NativeViewAccessible NativeViewAccessibilityBase::HitTestSync(int x,
int y) {
if (!view_ || !view_->GetWidget())
« no previous file with comments | « ui/views/accessibility/native_view_accessibility_base.h ('k') | ui/views/cocoa/bridged_content_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698