Commit 18b8c7af authored by Yuheng Huang's avatar Yuheng Huang Committed by Commit Bot

Tab Search: reduce debounce timeout value

This change makes close tab more responsive.
Since TabStripModel::CloseWebContentsAt() mostly return false,
how fast TabsChanged() is sent
to the web/js side depends on the debounce timeout value.

Bug: 1099917

Change-Id: Icd7c2a5bc45ba2b8361f8ccc5d61033ed0103462
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2335505
Commit-Queue: Yuheng Huang <yuhengh@chromium.org>
Reviewed-by: default avatarThomas Lukaszewicz <tluk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#794353}
parent 33b7d63a
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
namespace { namespace {
constexpr base::TimeDelta kTabsChangeDelay = constexpr base::TimeDelta kTabsChangeDelay =
base::TimeDelta::FromMilliseconds(500); base::TimeDelta::FromMilliseconds(50);
} }
TabSearchPageHandler::TabSearchPageHandler( TabSearchPageHandler::TabSearchPageHandler(
...@@ -159,6 +159,8 @@ void TabSearchPageHandler::OnTabStripModelChanged( ...@@ -159,6 +159,8 @@ void TabSearchPageHandler::OnTabStripModelChanged(
void TabSearchPageHandler::TabChangedAt(content::WebContents* contents, void TabSearchPageHandler::TabChangedAt(content::WebContents* contents,
int index, int index,
TabChangeType change_type) { TabChangeType change_type) {
// TODO(crbug.com/1112496): Support more values for TabChangeType and filter
// out the changes we are not interested in.
if (change_type == TabChangeType::kAll) if (change_type == TabChangeType::kAll)
ScheduleDebounce(); ScheduleDebounce();
} }
......
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