Commit 44326d9d authored by Yuheng Huang's avatar Yuheng Huang Committed by Commit Bot

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/+/2382655Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarThomas Lukaszewicz <tluk@chromium.org>
Commit-Queue: Yuheng Huang <yuhengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805629}
parent aa990024
...@@ -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