Commit 1b0a558c authored by Yuheng Huang's avatar Yuheng Huang Committed by Commit Bot

Reland "Tab Search: Add last_active_time_ticks to tab_search.mojom.Tab"

Reason for the revert:
Unfortunately our JS browser test lives in an internal repository and it
doesn't pick up by any presubmit trybot. That being said, to prevent a
revert from a post submit test failure we need to make sure the tests in
the internal repository passed after this CL is landed.

Now the following CL is submitted and auto-rolled into src-internal and
src so we are good to go.
https://chrome-internal-review.googlesource.com/c/chrome/browser/resources/tab_search/+/3261333

This is a reland of 44326d9d

Original change's description:
> Tab Search: Add last_active_time_ticks to tab_search.mojom.Tab
>
> last_active_time_ticks is used to sort recent tabs.
>
> Bug: 1099917
> Change-Id: If5c224729e39c20ceda48a3d81b6e171b92be731
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2382655
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Reviewed-by: Thomas Lukaszewicz <tluk@chromium.org>
> Commit-Queue: Yuheng Huang <yuhengh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#805629}

Bug: 1099917
Change-Id: Ice54eb41d177719ce53a0aef876eec6ebbcfd07a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2405613
Commit-Queue: Yuheng Huang <yuhengh@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806046}
parent 988b0bcd
...@@ -6,4 +6,5 @@ import("//mojo/public/tools/bindings/mojom.gni") ...@@ -6,4 +6,5 @@ import("//mojo/public/tools/bindings/mojom.gni")
mojom("mojo_bindings") { mojom("mojo_bindings") {
sources = [ "tab_search.mojom" ] sources = [ "tab_search.mojom" ]
public_deps = [ "//mojo/public/mojom/base" ]
} }
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
module tab_search.mojom; module tab_search.mojom;
import "mojo/public/mojom/base/time.mojom";
// Collection of WindowTabs of a profile. // Collection of WindowTabs of a profile.
struct ProfileTabs { struct ProfileTabs {
array<WindowTabs> windows; array<WindowTabs> windows;
...@@ -27,6 +29,7 @@ struct Tab { ...@@ -27,6 +29,7 @@ struct Tab {
string? fav_icon_url; string? fav_icon_url;
bool is_default_favicon; bool is_default_favicon;
bool show_icon; bool show_icon;
mojo_base.mojom.TimeTicks last_active_time_ticks;
}; };
// Collection of tab groups. // Collection of tab groups.
......
...@@ -185,6 +185,7 @@ tab_search::mojom::TabPtr TabSearchPageHandler::GetTabData( ...@@ -185,6 +185,7 @@ tab_search::mojom::TabPtr TabSearchPageHandler::GetTabData(
favicon::GetDefaultFavicon().AsImageSkia()); favicon::GetDefaultFavicon().AsImageSkia());
} }
tab_data->show_icon = tab_renderer_data.show_icon; tab_data->show_icon = tab_renderer_data.show_icon;
tab_data->last_active_time_ticks = contents->GetLastActiveTime();
return tab_data; return tab_data;
} }
......
...@@ -63,6 +63,7 @@ void ExpectNewTab(const tab_search::mojom::Tab* tab, ...@@ -63,6 +63,7 @@ void ExpectNewTab(const tab_search::mojom::Tab* tab,
EXPECT_TRUE(tab->fav_icon_url.has_value()); EXPECT_TRUE(tab->fav_icon_url.has_value());
EXPECT_TRUE(tab->is_default_favicon); EXPECT_TRUE(tab->is_default_favicon);
EXPECT_TRUE(tab->show_icon); EXPECT_TRUE(tab->show_icon);
EXPECT_GT(tab->last_active_time_ticks, base::TimeTicks());
} }
void ExpectProfileTabs(tab_search::mojom::ProfileTabs* profile_tabs) { void ExpectProfileTabs(tab_search::mojom::ProfileTabs* profile_tabs) {
......
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