Commit 695bc51a authored by James Cook's avatar James Cook Committed by Commit Bot

Assert ViewsDelegate::HandleAccessibilityEvent requires non-null view

The only callers pass |this| for the view argument, so CHECK that it
isn't null and remove some dead code.

This simplifies an upcoming refactor in AXRemoteHost for mash.

TBR=msw@chromium.org

Bug: 888147
Test: existing unit tests
Change-Id: I93c9bb9ea5a9e55cbca5f51340625ffe60fe64d8
Reviewed-on: https://chromium-review.googlesource.com/c/1273991Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599272}
parent 1f633e35
...@@ -71,13 +71,10 @@ void AutomationManagerAura::Disable() { ...@@ -71,13 +71,10 @@ void AutomationManagerAura::Disable() {
void AutomationManagerAura::HandleEvent(views::View* view, void AutomationManagerAura::HandleEvent(views::View* view,
ax::mojom::Event event_type) { ax::mojom::Event event_type) {
if (!enabled_) CHECK(view);
return;
if (!view) { if (!enabled_)
SendEvent(current_tree_->GetRoot(), event_type);
return; return;
}
views::AXAuraObjWrapper* obj = views::AXAuraObjWrapper* obj =
views::AXAuraObjCache::GetInstance()->GetOrCreate(view); views::AXAuraObjCache::GetInstance()->GetOrCreate(view);
......
...@@ -99,13 +99,10 @@ void AXRemoteHost::StopMonitoringWidget() { ...@@ -99,13 +99,10 @@ void AXRemoteHost::StopMonitoringWidget() {
} }
void AXRemoteHost::HandleEvent(View* view, ax::mojom::Event event_type) { void AXRemoteHost::HandleEvent(View* view, ax::mojom::Event event_type) {
if (!enabled_) CHECK(view);
return;
if (!view) { if (!enabled_)
SendEvent(tree_source_->GetRoot(), event_type);
return; return;
}
// Can return null for views without a widget. // Can return null for views without a widget.
AXAuraObjWrapper* aura_obj = AXAuraObjCache::GetInstance()->GetOrCreate(view); AXAuraObjWrapper* aura_obj = AXAuraObjCache::GetInstance()->GetOrCreate(view);
......
...@@ -126,6 +126,7 @@ class VIEWS_EXPORT ViewsDelegate { ...@@ -126,6 +126,7 @@ class VIEWS_EXPORT ViewsDelegate {
gfx::Rect* bounds, gfx::Rect* bounds,
ui::WindowShowState* show_state) const; ui::WindowShowState* show_state) const;
// Handles an event on a |view|. The |view| must not be null.
virtual void NotifyAccessibilityEvent(View* view, virtual void NotifyAccessibilityEvent(View* view,
ax::mojom::Event event_type); ax::mojom::Event event_type);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment