Commit 4ea69447 authored by Katie D's avatar Katie D Committed by Commit Bot

Change the STS EventRewriter to an EventHandler at a11y priority.

This makes the STS EventRewriter work with Sticky Keys mode, and
is basically a revert of commit 0c0f3795
along with porting other modifications made since that commit.

Bug: 819860
Change-Id: I340295ac0ca6e24057fcb9d4a0890d77b3cf0439
Reviewed-on: https://chromium-review.googlesource.com/988849
Commit-Queue: Katie Dektar <katie@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547553}
parent c813adf6
......@@ -245,8 +245,8 @@ source_set("chromeos") {
"accessibility/event_handler_common.h",
"accessibility/magnification_manager.cc",
"accessibility/magnification_manager.h",
"accessibility/select_to_speak_event_rewriter.cc",
"accessibility/select_to_speak_event_rewriter.h",
"accessibility/select_to_speak_event_handler.cc",
"accessibility/select_to_speak_event_handler.h",
"accessibility/spoken_feedback_event_rewriter.cc",
"accessibility/spoken_feedback_event_rewriter.h",
"accessibility/switch_access_event_handler.cc",
......@@ -1812,7 +1812,7 @@ source_set("unit_tests") {
"../policy/default_geolocation_policy_handler_unittest.cc",
"../ui/browser_finder_chromeos_unittest.cc",
"accessibility/magnification_manager_unittest.cc",
"accessibility/select_to_speak_event_rewriter_unittest.cc",
"accessibility/select_to_speak_event_handler_unittest.cc",
"accessibility/spoken_feedback_event_rewriter_unittest.cc",
"app_mode/startup_app_launcher_unittest.cc",
"arc/accessibility/arc_accessibility_helper_bridge_unittest.cc",
......
......@@ -35,6 +35,7 @@
#include "chrome/browser/chromeos/accessibility/accessibility_extension_loader.h"
#include "chrome/browser/chromeos/accessibility/dictation_chromeos.h"
#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
#include "chrome/browser/chromeos/accessibility/select_to_speak_event_handler.h"
#include "chrome/browser/chromeos/accessibility/switch_access_event_handler.h"
#include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
#include "chrome/browser/chromeos/ash_config.h"
......@@ -766,10 +767,14 @@ void AccessibilityManager::OnSelectToSpeakChanged() {
enabled);
NotifyAccessibilityStatusChanged(details);
if (enabled)
if (enabled) {
select_to_speak_loader_->Load(profile_, base::Closure() /* done_cb */);
else
select_to_speak_event_handler_.reset(
new chromeos::SelectToSpeakEventHandler());
} else {
select_to_speak_loader_->Unload();
select_to_speak_event_handler_.reset(nullptr);
}
}
void AccessibilityManager::SetSwitchAccessEnabled(bool enabled) {
......
......@@ -41,6 +41,7 @@ class Rect;
namespace chromeos {
class AccessibilityExtensionLoader;
class SelectToSpeakEventHandler;
class SwitchAccessEventHandler;
enum AccessibilityNotificationType {
......@@ -436,6 +437,9 @@ class AccessibilityManager
std::unique_ptr<AccessibilityExtensionLoader> select_to_speak_loader_;
std::unique_ptr<chromeos::SelectToSpeakEventHandler>
select_to_speak_event_handler_;
std::unique_ptr<AccessibilityExtensionLoader> switch_access_loader_;
std::unique_ptr<chromeos::SwitchAccessEventHandler>
......
......@@ -2,14 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/chromeos/accessibility/select_to_speak_event_rewriter.h"
#include "chrome/browser/chromeos/accessibility/select_to_speak_event_handler.h"
#include <memory>
#include <string>
#include <utility>
#include "ash/root_window_controller.h"
#include "ash/shell.h"
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
#include "chrome/browser/chromeos/accessibility/event_handler_common.h"
#include "chrome/common/extensions/extension_constants.h"
......@@ -21,6 +19,7 @@
#include "extensions/browser/extension_host.h"
#include "third_party/WebKit/public/platform/WebMouseEvent.h"
#include "ui/aura/client/screen_position_client.h"
#include "ui/aura/env.h"
#include "ui/aura/window.h"
#include "ui/aura/window_tree_host.h"
#include "ui/content_accelerators/accelerator_util.h"
......@@ -29,6 +28,8 @@
#include "ui/events/event.h"
#include "ui/events/event_sink.h"
namespace chromeos {
namespace {
gfx::PointF GetScreenLocationFromEvent(const ui::LocatedEvent& event) {
......@@ -47,26 +48,36 @@ gfx::PointF GetScreenLocationFromEvent(const ui::LocatedEvent& event) {
const ui::KeyboardCode kSpeakSelectionKey = ui::VKEY_S;
SelectToSpeakEventRewriter::SelectToSpeakEventRewriter(
aura::Window* root_window)
: root_window_(root_window) {
DCHECK(root_window_);
SelectToSpeakEventHandler::SelectToSpeakEventHandler() {
// Add this to the root level EventTarget so that it is called first.
// TODO(katie): instead of using the root level EventTarget, just add this
// handler to ash::Shell::Get()->GetPrimaryRootWindow().
if (aura::Env::GetInstanceDontCreate())
aura::Env::GetInstanceDontCreate()->AddPreTargetHandler(
this, ui::EventTarget::Priority::kAccessibility);
}
SelectToSpeakEventRewriter::~SelectToSpeakEventRewriter() = default;
SelectToSpeakEventHandler::~SelectToSpeakEventHandler() {
if (aura::Env::GetInstanceDontCreate())
aura::Env::GetInstanceDontCreate()->AddPreTargetHandler(
this, ui::EventTarget::Priority::kAccessibility);
}
void SelectToSpeakEventRewriter::CaptureForwardedEventsForTesting(
void SelectToSpeakEventHandler::CaptureForwardedEventsForTesting(
SelectToSpeakEventDelegateForTesting* delegate) {
event_delegate_for_testing_ = delegate;
}
bool SelectToSpeakEventRewriter::IsSelectToSpeakEnabled() {
bool SelectToSpeakEventHandler::IsSelectToSpeakEnabled() {
if (event_delegate_for_testing_)
return true;
return chromeos::AccessibilityManager::Get()->IsSelectToSpeakEnabled();
}
bool SelectToSpeakEventRewriter::OnKeyEvent(const ui::KeyEvent* event) {
void SelectToSpeakEventHandler::OnKeyEvent(ui::KeyEvent* event) {
if (!IsSelectToSpeakEnabled())
return;
DCHECK(event);
// We can only call TtsController on the UI thread, make sure we
......@@ -130,13 +141,17 @@ bool SelectToSpeakEventRewriter::OnKeyEvent(const ui::KeyEvent* event) {
if (host)
chromeos::ForwardKeyToExtension(*event, host);
return cancel_event;
if (cancel_event)
CancelEvent(event);
}
bool SelectToSpeakEventRewriter::OnMouseEvent(const ui::MouseEvent* event) {
void SelectToSpeakEventHandler::OnMouseEvent(ui::MouseEvent* event) {
if (!IsSelectToSpeakEnabled())
return;
DCHECK(event);
if (state_ == INACTIVE)
return false;
return;
if ((state_ == SEARCH_DOWN || state_ == MOUSE_RELEASED) &&
event->type() == ui::ET_MOUSE_PRESSED) {
......@@ -146,17 +161,16 @@ bool SelectToSpeakEventRewriter::OnMouseEvent(const ui::MouseEvent* event) {
if (state_ == WAIT_FOR_MOUSE_RELEASE &&
event->type() == ui::ET_MOUSE_RELEASED) {
state_ = INACTIVE;
return false;
return;
}
if (state_ != CAPTURING_MOUSE)
return false;
return;
if (event->type() == ui::ET_MOUSE_RELEASED)
state_ = MOUSE_RELEASED;
ui::MouseEvent mutable_event(*event);
ConvertMouseEventToDIPs(&mutable_event);
// If we're in the capturing mouse state, forward the mouse event to
// select-to-speak.
......@@ -167,64 +181,28 @@ bool SelectToSpeakEventRewriter::OnMouseEvent(const ui::MouseEvent* event) {
extensions::ExtensionHost* host = chromeos::GetAccessibilityExtensionHost(
extension_misc::kSelectToSpeakExtensionId);
if (!host)
return false;
return;
content::RenderViewHost* rvh = host->render_view_host();
if (!rvh)
return false;
return;
const blink::WebMouseEvent web_event = ui::MakeWebMouseEvent(
mutable_event, base::Bind(&GetScreenLocationFromEvent));
rvh->GetWidget()->ForwardMouseEvent(web_event);
}
return true;
}
void SelectToSpeakEventRewriter::ConvertMouseEventToDIPs(
ui::MouseEvent* mouse_event) {
// The event is in Pixels, and needs to be scaled to DIPs.
gfx::Point location = mouse_event->location();
gfx::Point root_location = mouse_event->root_location();
root_window_->GetHost()->ConvertPixelsToDIP(&location);
root_window_->GetHost()->ConvertPixelsToDIP(&root_location);
mouse_event->set_location(location);
mouse_event->set_root_location(root_location);
if (event->type() == ui::ET_MOUSE_PRESSED ||
event->type() == ui::ET_MOUSE_RELEASED)
CancelEvent(event);
}
ui::EventRewriteStatus SelectToSpeakEventRewriter::RewriteEvent(
const ui::Event& event,
std::unique_ptr<ui::Event>* new_event) {
if (!IsSelectToSpeakEnabled())
return ui::EVENT_REWRITE_CONTINUE;
if (event.type() == ui::ET_KEY_PRESSED ||
event.type() == ui::ET_KEY_RELEASED) {
const ui::KeyEvent key_event = static_cast<const ui::KeyEvent&>(event);
if (OnKeyEvent(&key_event))
return ui::EVENT_REWRITE_DISCARD;
}
if (event.type() == ui::ET_MOUSE_PRESSED ||
event.type() == ui::ET_MOUSE_DRAGGED ||
event.type() == ui::ET_MOUSE_RELEASED ||
event.type() == ui::ET_MOUSE_MOVED) {
const ui::MouseEvent mouse_event =
static_cast<const ui::MouseEvent&>(event);
if (OnMouseEvent(&mouse_event) && (event.type() == ui::ET_MOUSE_PRESSED ||
event.type() == ui::ET_MOUSE_RELEASED)) {
// Cancel only click events if they were consumed by Select-to-Speak.
// Mouse move and drag should still happen or the mouse cursor may
// not be drawn in the right place.
return ui::EVENT_REWRITE_DISCARD;
}
void SelectToSpeakEventHandler::CancelEvent(ui::Event* event) {
DCHECK(event);
if (event->cancelable()) {
event->SetHandled();
event->StopPropagation();
}
return ui::EVENT_REWRITE_CONTINUE;
}
ui::EventRewriteStatus SelectToSpeakEventRewriter::NextDispatchEvent(
const ui::Event& last_event,
std::unique_ptr<ui::Event>* new_event) {
return ui::EVENT_REWRITE_CONTINUE;
}
} // namespace chromeos
......@@ -2,19 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_SELECT_TO_SPEAK_EVENT_REWRITER_H_
#define CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_SELECT_TO_SPEAK_EVENT_REWRITER_H_
#ifndef CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_SELECT_TO_SPEAK_EVENT_HANDLER_H_
#define CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_SELECT_TO_SPEAK_EVENT_HANDLER_H_
#include <memory>
#include "base/macros.h"
#include "ui/aura/window.h"
#include "ui/events/event_rewriter.h"
#include "ui/events/event_handler.h"
namespace ui {
class KeyEvent;
class MouseEvent;
} // namespace ui
namespace chromeos {
class SelectToSpeakEventDelegateForTesting {
public:
......@@ -24,35 +20,27 @@ class SelectToSpeakEventDelegateForTesting {
const ui::MouseEvent& event) = 0;
};
class SelectToSpeakEventRewriter : public ui::EventRewriter {
class SelectToSpeakEventHandler : public ui::EventHandler {
public:
explicit SelectToSpeakEventRewriter(aura::Window* root_window);
~SelectToSpeakEventRewriter() override;
SelectToSpeakEventHandler();
~SelectToSpeakEventHandler() override;
void CaptureForwardedEventsForTesting(
SelectToSpeakEventDelegateForTesting* delegate);
private:
// EventHandler
void OnKeyEvent(ui::KeyEvent* event) override;
void OnMouseEvent(ui::MouseEvent* event) override;
// Returns true if Select to Speak is enabled.
bool IsSelectToSpeakEnabled();
// Returns true if the event was consumed and should be canceled.
bool OnKeyEvent(const ui::KeyEvent* event);
// Returns true if the event was consumed and should be canceled.
bool OnMouseEvent(const ui::MouseEvent* event);
void CancelEvent(ui::Event* event);
// Converts an event in pixels to the same event in DIPs.
void ConvertMouseEventToDIPs(ui::MouseEvent* mouse_event);
// EventRewriter:
ui::EventRewriteStatus RewriteEvent(
const ui::Event& event,
std::unique_ptr<ui::Event>* new_event) override;
ui::EventRewriteStatus NextDispatchEvent(
const ui::Event& last_event,
std::unique_ptr<ui::Event>* new_event) override;
enum State {
// The search key is not down. No other keys or mouse events are captured.
INACTIVE,
......@@ -95,11 +83,12 @@ class SelectToSpeakEventRewriter : public ui::EventRewriter {
};
State state_ = INACTIVE;
aura::Window* root_window_;
SelectToSpeakEventDelegateForTesting* event_delegate_for_testing_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(SelectToSpeakEventRewriter);
DISALLOW_COPY_AND_ASSIGN(SelectToSpeakEventHandler);
};
#endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_SELECT_TO_SPEAK_EVENT_REWRITER_H_
} // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_SELECT_TO_SPEAK_EVENT_HANDLER_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/chromeos/accessibility/select_to_speak_event_rewriter.h"
#include "chrome/browser/chromeos/accessibility/select_to_speak_event_handler.h"
#include <set>
......@@ -22,6 +22,8 @@
#include "ui/events/test/event_generator.h"
#include "ui/events/test/events_test_utils.h"
using chromeos::SelectToSpeakEventHandler;
namespace {
// Records all key events for testing.
......@@ -53,7 +55,7 @@ class EventCapturer : public ui::EventHandler {
};
class SelectToSpeakMouseEventDelegate final
: public SelectToSpeakEventDelegateForTesting {
: public chromeos::SelectToSpeakEventDelegateForTesting {
public:
SelectToSpeakMouseEventDelegate() {}
......@@ -82,9 +84,9 @@ class SelectToSpeakMouseEventDelegate final
DISALLOW_COPY_AND_ASSIGN(SelectToSpeakMouseEventDelegate);
};
class SelectToSpeakEventRewriterTest : public ash::AshTestBase {
class SelectToSpeakEventHandlerTest : public ash::AshTestBase {
public:
SelectToSpeakEventRewriterTest() : generator_(nullptr) {}
SelectToSpeakEventHandlerTest() : generator_(nullptr) {}
void SetUp() override {
ash::AshTestBase::SetUp();
......@@ -92,21 +94,16 @@ class SelectToSpeakEventRewriterTest : public ash::AshTestBase {
// throttling events. set_throttle_input_on_resize_for_testing() disables
// this.
aura::Env::GetInstance()->set_throttle_input_on_resize_for_testing(false);
select_to_speak_event_rewriter_.reset(
new SelectToSpeakEventRewriter(CurrentContext()));
select_to_speak_event_handler_.reset(new SelectToSpeakEventHandler());
mouse_event_delegate_.reset(new SelectToSpeakMouseEventDelegate());
select_to_speak_event_rewriter_->CaptureForwardedEventsForTesting(
select_to_speak_event_handler_->CaptureForwardedEventsForTesting(
mouse_event_delegate_.get());
generator_ = &AshTestBase::GetEventGenerator();
CurrentContext()->GetHost()->GetEventSource()->AddEventRewriter(
select_to_speak_event_rewriter_.get());
CurrentContext()->AddPreTargetHandler(&event_capturer_);
AutomationManagerAura::GetInstance()->Enable(&profile_);
}
void TearDown() override {
CurrentContext()->GetHost()->GetEventSource()->RemoveEventRewriter(
select_to_speak_event_rewriter_.get());
CurrentContext()->RemovePreTargetHandler(&event_capturer_);
generator_ = nullptr;
ash::AshTestBase::TearDown();
......@@ -119,16 +116,18 @@ class SelectToSpeakEventRewriterTest : public ash::AshTestBase {
std::unique_ptr<SelectToSpeakMouseEventDelegate> mouse_event_delegate_;
private:
std::unique_ptr<SelectToSpeakEventRewriter> select_to_speak_event_rewriter_;
std::unique_ptr<SelectToSpeakEventHandler> select_to_speak_event_handler_;
DISALLOW_COPY_AND_ASSIGN(SelectToSpeakEventRewriterTest);
DISALLOW_COPY_AND_ASSIGN(SelectToSpeakEventHandlerTest);
};
} // namespace
TEST_F(SelectToSpeakEventRewriterTest, PressAndReleaseSearchNotHandled) {
namespace chromeos {
TEST_F(SelectToSpeakEventHandlerTest, PressAndReleaseSearchNotHandled) {
// If the user presses and releases the Search key, with no mouse
// presses, the key events won't be handled by the SelectToSpeakEventRewriter
// presses, the key events won't be handled by the SelectToSpeakEventHandler
// and the normal behavior will occur.
EXPECT_FALSE(event_capturer_.last_key_event());
......@@ -145,7 +144,7 @@ TEST_F(SelectToSpeakEventRewriterTest, PressAndReleaseSearchNotHandled) {
// Note: when running these tests locally on desktop Linux, you may need
// to use xvfb-run, otherwise simulating the Search key press may not work.
TEST_F(SelectToSpeakEventRewriterTest, SearchPlusClick) {
TEST_F(SelectToSpeakEventHandlerTest, SearchPlusClick) {
// If the user holds the Search key and then clicks the mouse button,
// the mouse events and the key release event get handled by the
// SelectToSpeakEventRewriter, and mouse events are forwarded to the
......@@ -174,7 +173,7 @@ TEST_F(SelectToSpeakEventRewriterTest, SearchPlusClick) {
EXPECT_FALSE(event_capturer_.last_key_event());
}
TEST_F(SelectToSpeakEventRewriterTest, SearchPlusDrag) {
TEST_F(SelectToSpeakEventHandlerTest, SearchPlusDrag) {
// Mouse move events should also be captured.
generator_->PressKey(ui::VKEY_LWIN, ui::EF_COMMAND_DOWN);
......@@ -198,7 +197,7 @@ TEST_F(SelectToSpeakEventRewriterTest, SearchPlusDrag) {
generator_->ReleaseKey(ui::VKEY_LWIN, ui::EF_COMMAND_DOWN);
}
TEST_F(SelectToSpeakEventRewriterTest, SearchPlusDragOnLargeDisplay) {
TEST_F(SelectToSpeakEventHandlerTest, SearchPlusDragOnLargeDisplay) {
// This display has twice the number of pixels per DIP. This means that
// each event coming in in px needs to be divided by two to be converted
// to DIPs.
......@@ -227,7 +226,7 @@ TEST_F(SelectToSpeakEventRewriterTest, SearchPlusDragOnLargeDisplay) {
generator_->ReleaseKey(ui::VKEY_LWIN, ui::EF_COMMAND_DOWN);
}
TEST_F(SelectToSpeakEventRewriterTest, RepeatSearchKey) {
TEST_F(SelectToSpeakEventHandlerTest, RepeatSearchKey) {
// Holding the Search key may generate key repeat events. Make sure it's
// still treated as if the search key is down.
generator_->PressKey(ui::VKEY_LWIN, ui::EF_COMMAND_DOWN);
......@@ -252,7 +251,7 @@ TEST_F(SelectToSpeakEventRewriterTest, RepeatSearchKey) {
EXPECT_FALSE(event_capturer_.last_key_event());
}
TEST_F(SelectToSpeakEventRewriterTest, TapSearchKey) {
TEST_F(SelectToSpeakEventHandlerTest, TapSearchKey) {
// Tapping the search key should not steal future events.
event_capturer_.Reset();
......@@ -264,7 +263,7 @@ TEST_F(SelectToSpeakEventRewriterTest, TapSearchKey) {
EXPECT_FALSE(event_capturer_.last_mouse_event()->handled());
}
TEST_F(SelectToSpeakEventRewriterTest, SearchPlusClickTwice) {
TEST_F(SelectToSpeakEventHandlerTest, SearchPlusClickTwice) {
// Same as SearchPlusClick, above, but test that the user can keep
// holding down Search and click again.
......@@ -299,7 +298,7 @@ TEST_F(SelectToSpeakEventRewriterTest, SearchPlusClickTwice) {
EXPECT_FALSE(event_capturer_.last_key_event());
}
TEST_F(SelectToSpeakEventRewriterTest, SearchPlusKeyIgnoresClicks) {
TEST_F(SelectToSpeakEventHandlerTest, SearchPlusKeyIgnoresClicks) {
// If the user presses the Search key and then some other key,
// we should assume the user does not want select-to-speak, and
// click events should be ignored.
......@@ -337,7 +336,7 @@ TEST_F(SelectToSpeakEventRewriterTest, SearchPlusKeyIgnoresClicks) {
EXPECT_FALSE(event_capturer_.last_key_event()->handled());
}
TEST_F(SelectToSpeakEventRewriterTest, SearchPlusSIsCaptured) {
TEST_F(SelectToSpeakEventHandlerTest, SearchPlusSIsCaptured) {
generator_->PressKey(ui::VKEY_LWIN, ui::EF_COMMAND_DOWN);
// Press and release S, key presses should be captured.
......@@ -365,7 +364,7 @@ TEST_F(SelectToSpeakEventRewriterTest, SearchPlusSIsCaptured) {
ASSERT_FALSE(event_capturer_.last_key_event()->handled());
}
TEST_F(SelectToSpeakEventRewriterTest, SearchPlusSIgnoresMouse) {
TEST_F(SelectToSpeakEventHandlerTest, SearchPlusSIgnoresMouse) {
generator_->PressKey(ui::VKEY_LWIN, ui::EF_COMMAND_DOWN);
// Press S
......@@ -387,7 +386,7 @@ TEST_F(SelectToSpeakEventRewriterTest, SearchPlusSIgnoresMouse) {
ASSERT_FALSE(event_capturer_.last_key_event());
}
TEST_F(SelectToSpeakEventRewriterTest, SearchPlusMouseIgnoresS) {
TEST_F(SelectToSpeakEventHandlerTest, SearchPlusMouseIgnoresS) {
generator_->PressKey(ui::VKEY_LWIN, ui::EF_COMMAND_DOWN);
// Press the mouse
......@@ -397,15 +396,17 @@ TEST_F(SelectToSpeakEventRewriterTest, SearchPlusMouseIgnoresS) {
// S key events are passed through like normal.
generator_->PressKey(ui::VKEY_S, ui::EF_COMMAND_DOWN);
ASSERT_TRUE(event_capturer_.last_key_event());
EXPECT_TRUE(event_capturer_.last_key_event());
event_capturer_.Reset();
generator_->ReleaseKey(ui::VKEY_S, ui::EF_COMMAND_DOWN);
ASSERT_TRUE(event_capturer_.last_key_event());
EXPECT_TRUE(event_capturer_.last_key_event());
generator_->ReleaseLeftButton();
EXPECT_FALSE(event_capturer_.last_mouse_event());
event_capturer_.Reset();
generator_->ReleaseKey(ui::VKEY_LWIN, ui::EF_COMMAND_DOWN);
ASSERT_FALSE(event_capturer_.last_key_event());
EXPECT_FALSE(event_capturer_.last_key_event());
}
} // namespace chromeos
......@@ -10,7 +10,6 @@
#include <utility>
#include <vector>
#include "ash/root_window_controller.h"
#include "ash/shell.h"
#include "ash/sticky_keys/sticky_keys_controller.h"
#include "base/bind.h"
......@@ -35,7 +34,6 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
#include "chrome/browser/chromeos/accessibility/select_to_speak_event_rewriter.h"
#include "chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.h"
#include "chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_manager.h"
#include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h"
......@@ -1041,11 +1039,6 @@ void ChromeBrowserMainPartsChromeos::PostBrowserStart() {
std::unique_ptr<ui::EventRewriter>(new KeyboardDrivenEventRewriter()));
keyboard_event_rewriters_->AddEventRewriter(
std::unique_ptr<ui::EventRewriter>(new SpokenFeedbackEventRewriter()));
keyboard_event_rewriters_->AddEventRewriter(
std::unique_ptr<ui::EventRewriter>(new SelectToSpeakEventRewriter(
ash::Shell::Get()
->GetPrimaryRootWindowController()
->GetRootWindow())));
event_rewriter_delegate_ = std::make_unique<EventRewriterDelegateImpl>();
keyboard_event_rewriters_->AddEventRewriter(
std::make_unique<ui::EventRewriterChromeOS>(
......
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