Commit f14e735d authored by Yuwei Huang's avatar Yuwei Huang Committed by Commit Bot

[Fullscreen Control] Add 10s timeout for touch triggered FAB

Per discussion in the a11y meeting on May 30, this CL re-introduces a 10s
timeout for touch triggered FAB so that people using screen reader can
easily get back from the FAB to the web content.

Bug: 829613
Change-Id: I727d78967f6fb7780eaaaa40e5f5e9cf59b58613
Reviewed-on: https://chromium-review.googlesource.com/1132340
Commit-Queue: Yuwei Huang <yuweih@chromium.org>
Reviewed-by: default avatarRobert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575058}
parent af67b759
......@@ -55,7 +55,8 @@ constexpr float kExitHeightScaleFactor = 1.5f;
constexpr float kShowFullscreenExitControlHeight = 3.f;
// Time to wait to hide the popup after it is triggered.
constexpr base::TimeDelta kPopupTimeout = base::TimeDelta::FromSeconds(3);
constexpr base::TimeDelta kMousePopupTimeout = base::TimeDelta::FromSeconds(3);
constexpr base::TimeDelta kTouchPopupTimeout = base::TimeDelta::FromSeconds(10);
// Time to wait before showing the popup when the escape key is held.
constexpr base::TimeDelta kKeyPressPopupDelay = base::TimeDelta::FromSeconds(1);
......@@ -241,7 +242,9 @@ void FullscreenControlHost::OnVisibilityChanged() {
input_entry_method_ = InputEntryMethod::NOT_ACTIVE;
key_press_delay_timer_.Stop();
} else if (input_entry_method_ == InputEntryMethod::MOUSE) {
StartPopupTimeout(InputEntryMethod::MOUSE);
StartPopupTimeout(InputEntryMethod::MOUSE, kMousePopupTimeout);
} else if (input_entry_method_ == InputEntryMethod::TOUCH) {
StartPopupTimeout(InputEntryMethod::TOUCH, kTouchPopupTimeout);
}
if (on_popup_visibility_changed_)
......@@ -249,9 +252,10 @@ void FullscreenControlHost::OnVisibilityChanged() {
}
void FullscreenControlHost::StartPopupTimeout(
InputEntryMethod expected_input_method) {
InputEntryMethod expected_input_method,
base::TimeDelta timeout) {
popup_timeout_timer_.Start(
FROM_HERE, kPopupTimeout,
FROM_HERE, timeout,
base::BindRepeating(&FullscreenControlHost::OnPopupTimeout,
base::Unretained(this), expected_input_method));
}
......
......@@ -62,7 +62,8 @@ class FullscreenControlHost : public ui::EventHandler {
bool IsAnimating() const;
void ShowForInputEntryMethod(InputEntryMethod input_entry_method);
void OnVisibilityChanged();
void StartPopupTimeout(InputEntryMethod expected_input_method);
void StartPopupTimeout(InputEntryMethod expected_input_method,
base::TimeDelta timeout);
void OnPopupTimeout(InputEntryMethod expected_input_method);
bool IsExitUiNeeded();
float CalculateCursorBufferHeight() const;
......
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