Commit d20bec23 authored by Katie D's avatar Katie D Committed by Commit Bot

Autoclick should always re-enable as left click.

Left click is the most useful click type. Upon re-enable, autoclick
type should always be left click.

Also don't draw the scroll icon when disabled.

Bug: 988020,988007
Change-Id: I5f92376ac2f26bde0ecceea401c573a2f306a47f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1721510
Commit-Queue: Katie Dektar <katie@chromium.org>
Commit-Queue: Anastasia Helfinstein <anastasi@google.com>
Auto-Submit: Katie Dektar <katie@chromium.org>
Reviewed-by: default avatarAnastasia Helfinstein <anastasi@google.com>
Cr-Commit-Position: refs/heads/master@{#681408}
parent 234b225c
......@@ -157,6 +157,12 @@ void AutoclickController::SetEnabled(bool enabled,
HideScrollPosition();
Shell::Get()->RemovePreTargetHandler(this);
menu_bubble_controller_ = nullptr;
// Set the click type to left-click. This is the most useful click type
// and users will want this type when they re-enable. If users were to
// re-enable in scroll, or right-click, they would need to use the bubble
// menu to change types.
Shell::Get()->accessibility_controller()->SetAutoclickEventType(
AutoclickEventType::kLeftClick);
enabled_ = enabled;
}
}
......@@ -520,6 +526,8 @@ void AutoclickController::InitializeScrollLocation() {
void AutoclickController::UpdateScrollPosition(
const gfx::Point& point_in_screen) {
if (!enabled_)
return;
if (!scroll_position_widget_) {
CreateAutoclickScrollPositionWidget(point_in_screen);
autoclick_scroll_position_handler_ =
......
......@@ -244,6 +244,10 @@ TEST_F(AutoclickTest, ToggleEnabled) {
EXPECT_FALSE(GetAutoclickController()->IsEnabled());
events = WaitForMouseEvents();
EXPECT_EQ(0u, events.size());
// After disable, autoclick should be set back to left click.
EXPECT_EQ(AutoclickEventType::kLeftClick,
Shell::Get()->accessibility_controller()->GetAutoclickEventType());
}
TEST_F(AutoclickTest, MouseMovement) {
......
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