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

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

Issue 2852763002: Added a system caret used for accessibility on Windows. (Closed)
Patch Set: Added a fake caret for accessibility. 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
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 5018970b001623ea6f5502b608e7acdc78d5cf37..f087893e0d1df1504eb228b2c5ee7f635c7e1c32 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 AXFakeCaretWin;
+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 {}
sky 2017/06/19 15:00:14 Don't inline virtual functions like this in the he
+ 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,
@@ -566,6 +579,11 @@ class VIEWS_EXPORT HWNDMessageHandler :
// px on activation loss to a window on the same monitor.
void OnBackgroundFullscreen();
+ // Destructs the fake caret used for accessibility. This will result in any
sky 2017/06/19 15:00:14 Destructs -> Deletes
+ // clients that are still holding onto its |IAccessible| to get a failure code
+ // if they request its location.
+ void DestroyFakeCaret();
+
HWNDMessageHandlerDelegate* delegate_;
std::unique_ptr<FullscreenHandler> fullscreen_handler_;
@@ -690,6 +708,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::AXFakeCaretWin> ax_fake_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.

Powered by Google App Engine
This is Rietveld 408576698