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

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

Issue 2962273002: Revert of Added a system caret used for accessibility on Windows. (Closed)
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/win/hwnd_message_handler.h ('k') | ui/views/win/hwnd_message_handler_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/win/hwnd_message_handler.cc
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 5190e41832157dbb3fb8c68774d998394d61e181..01c372801fee23a42f890ab9f3afb54b7d5733d3 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -21,14 +21,8 @@
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
-#include "base/win/scoped_comptr.h"
#include "base/win/scoped_gdi_object.h"
#include "base/win/windows_version.h"
-#include "ui/accessibility/platform/ax_platform_node_win.h"
-#include "ui/accessibility/platform/ax_system_caret_win.h"
-#include "ui/base/ime/input_method.h"
-#include "ui/base/ime/text_input_client.h"
-#include "ui/base/ime/text_input_type.h"
#include "ui/base/view_prop.h"
#include "ui/base/win/internal_constants.h"
#include "ui/base/win/lock_state.h"
@@ -368,8 +362,6 @@
weak_factory_(this) {}
HWNDMessageHandler::~HWNDMessageHandler() {
- DCHECK(delegate_->GetHWNDMessageDelegateInputMethod());
- delegate_->GetHWNDMessageDelegateInputMethod()->RemoveObserver(this);
delegate_ = NULL;
// Prevent calls back into this class via WNDPROC now that we've been
// destroyed.
@@ -403,8 +395,6 @@
prop_window_target_.reset(new ui::ViewProp(hwnd(),
ui::WindowEventTarget::kWin32InputEventTarget,
static_cast<ui::WindowEventTarget*>(this)));
- DCHECK(delegate_->GetHWNDMessageDelegateInputMethod());
- delegate_->GetHWNDMessageDelegateInputMethod()->AddObserver(this);
// Direct Manipulation is enabled on Windows 10+. The CreateInstance function
// returns NULL if Direct Manipulation is not available.
@@ -959,46 +949,6 @@
return result;
}
-void HWNDMessageHandler::OnTextInputTypeChanged(
- const ui::TextInputClient* client) {
- if (!client || client->GetTextInputType() == ui::TEXT_INPUT_TYPE_NONE) {
- DestroyAXSystemCaret();
- return;
- }
-
- OnCaretBoundsChanged(client);
-}
-
-void HWNDMessageHandler::OnFocus() {}
-
-void HWNDMessageHandler::OnBlur() {}
-
-void HWNDMessageHandler::OnCaretBoundsChanged(
- const ui::TextInputClient* client) {
- if (!client || client->GetTextInputType() == ui::TEXT_INPUT_TYPE_NONE)
- return;
-
- if (!ax_system_caret_)
- ax_system_caret_ = std::make_unique<ui::AXSystemCaretWin>(hwnd());
-
- const gfx::Rect dip_caret_bounds(client->GetCaretBounds());
- gfx::Rect caret_bounds =
- display::win::ScreenWin::DIPToScreenRect(hwnd(), dip_caret_bounds);
- // Collapse any selection.
- caret_bounds.set_width(1);
- ax_system_caret_->MoveCaretTo(caret_bounds);
-}
-
-void HWNDMessageHandler::OnTextInputStateChanged(
- const ui::TextInputClient* client) {}
-
-void HWNDMessageHandler::OnInputMethodDestroyed(
- const ui::InputMethod* input_method) {
- DestroyAXSystemCaret();
-}
-
-void HWNDMessageHandler::OnShowImeIfNeeded() {}
-
LRESULT HWNDMessageHandler::HandleMouseMessage(unsigned int message,
WPARAM w_param,
LPARAM l_param,
@@ -1583,14 +1533,10 @@
// Retrieve MSAA dispatch object for the root view.
base::win::ScopedComPtr<IAccessible> root(
delegate_->GetNativeViewAccessible());
+
+ // Create a reference that MSAA will marshall to the client.
reference_result = LresultFromObject(IID_IAccessible, w_param,
static_cast<IAccessible*>(root.Detach()));
- } else if (::GetFocus() == hwnd() && ax_system_caret_ &&
- static_cast<DWORD>(OBJID_CARET) == obj_id) {
- base::win::ScopedComPtr<IAccessible> ax_system_caret_accessible =
- ax_system_caret_->GetCaret();
- reference_result = LresultFromObject(IID_IAccessible, w_param,
- ax_system_caret_accessible.Detach());
}
return reference_result;
@@ -2234,7 +2180,6 @@
(notification_code & sc_mask) == SC_MAXIMIZE ||
(notification_code & sc_mask) == SC_RESTORE) {
delegate_->ResetWindowControls();
- DestroyAXSystemCaret();
} else if ((notification_code & sc_mask) == SC_MOVE ||
(notification_code & sc_mask) == SC_SIZE) {
if (!IsVisible()) {
@@ -2243,7 +2188,6 @@
SetWindowLong(hwnd(), GWL_STYLE,
GetWindowLong(hwnd(), GWL_STYLE) | WS_VISIBLE);
}
- DestroyAXSystemCaret();
}
}
@@ -3058,8 +3002,4 @@
SetBoundsInternal(shrunk_rect, false);
}
-void HWNDMessageHandler::DestroyAXSystemCaret() {
- ax_system_caret_ = nullptr;
-}
-
} // namespace views
« no previous file with comments | « ui/views/win/hwnd_message_handler.h ('k') | ui/views/win/hwnd_message_handler_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698