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

Unified Diff: ui/views/win/hwnd_message_handler.h

Issue 2852763002: Added a system caret used for accessibility on Windows. (Closed)
Patch Set: Disabled all tests Created 3 years, 5 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/widget/desktop_aura/desktop_window_tree_host_win.cc ('k') | ui/views/win/hwnd_message_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/win/hwnd_message_handler.h
diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h
index bdfbaffcaa731d8793fc36b706dd527afbf48627..a1379adc80c6e402574af26066781f41fcdedd6d 100644
--- a/ui/views/win/hwnd_message_handler.h
+++ b/ui/views/win/hwnd_message_handler.h
@@ -21,6 +21,7 @@
#include "base/win/scoped_gdi_object.h"
#include "base/win/win_util.h"
#include "ui/accessibility/ax_enums.h"
+#include "ui/base/ime/input_method_observer.h"
#include "ui/base/ui_base_types.h"
#include "ui/base/win/window_event_target.h"
#include "ui/events/event.h"
@@ -38,6 +39,9 @@ class DirectManipulationHelper;
} // namespace gfx
namespace ui {
+class AXSystemCaretWin;
+class InputMethod;
+class TextInputClient;
class ViewProp;
}
@@ -117,9 +121,9 @@ const int WM_WINDOWSIZINGFINISHED = WM_USER;
// used by both a views::NativeWidget and an aura::WindowTreeHost
// implementation.
// TODO(beng): This object should eventually *become* the WindowImpl.
-class VIEWS_EXPORT HWNDMessageHandler :
- public gfx::WindowImpl,
- public ui::WindowEventTarget {
+class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl,
+ public ui::InputMethodObserver,
+ public ui::WindowEventTarget {
public:
explicit HWNDMessageHandler(HWNDMessageHandlerDelegate* delegate);
~HWNDMessageHandler() override;
@@ -227,6 +231,15 @@ class VIEWS_EXPORT HWNDMessageHandler :
HICON GetSmallWindowIcon() const override;
LRESULT OnWndProc(UINT message, WPARAM w_param, LPARAM l_param) override;
+ // Overridden from InputMethodObserver
+ void OnTextInputTypeChanged(const ui::TextInputClient* client) override;
+ void OnFocus() override;
+ void OnBlur() override;
+ void OnCaretBoundsChanged(const ui::TextInputClient* client) override;
+ void OnTextInputStateChanged(const ui::TextInputClient* client) override;
+ void OnInputMethodDestroyed(const ui::InputMethod* input_method) override;
+ void OnShowImeIfNeeded() override;
+
// Overridden from WindowEventTarget
LRESULT HandleMouseMessage(unsigned int message,
WPARAM w_param,
@@ -574,6 +587,11 @@ class VIEWS_EXPORT HWNDMessageHandler :
// px on activation loss to a window on the same monitor.
void OnBackgroundFullscreen();
+ // Deletes the system caret used for accessibility. This will result in any
+ // clients that are still holding onto its |IAccessible| to get a failure code
+ // if they request its location.
+ void DestroyAXSystemCaret();
+
HWNDMessageHandlerDelegate* delegate_;
std::unique_ptr<FullscreenHandler> fullscreen_handler_;
@@ -698,6 +716,9 @@ class VIEWS_EXPORT HWNDMessageHandler :
std::unique_ptr<WindowsSessionChangeObserver>
windows_session_change_observer_;
+ // Some assistive software need to track the location of the caret.
+ std::unique_ptr<ui::AXSystemCaretWin> ax_system_caret_;
+
// This class provides functionality to register the legacy window as a
// Direct Manipulation consumer. This allows us to support smooth scroll
// in Chrome on Windows 10.
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc ('k') | ui/views/win/hwnd_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698