Commit f9c935b7 authored by Ben Wells's avatar Ben Wells Committed by Commit Bot

Change eligible auto top level navigations to earn engagement.

Auto top level navigations include things like command line navigations,
in product help links, and other similar navigations. It is possible
for these types of navigations to earn engagement if they meet other
checks (e.g. have a valid scheme).

The reason to change this is to allow command line navigations to earn
engagement.

Bug: 944396
Change-Id: I7846675fd7955a2473c0951df60251661eaa1f96
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1535201
Commit-Queue: Ben Wells <benwells@chromium.org>
Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#644702}
parent b31d0f26
......@@ -131,7 +131,9 @@ std::vector<mojom::SiteEngagementDetails> GetAllDetailsImpl(
// b. clicking on an omnibox suggestion brought up by typing a keyword
// c. clicking on a bookmark or opening a bookmark app
// d. a custom search engine keyword search (e.g. Wikipedia search box added as
// search engine).
// search engine)
// e. an automatically generated top level navigation (e.g. command line
// navigation, in product help link).
bool IsEngagementNavigation(ui::PageTransition transition) {
return ui::PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_TYPED) ||
ui::PageTransitionCoreTypeIs(transition,
......@@ -139,7 +141,9 @@ bool IsEngagementNavigation(ui::PageTransition transition) {
ui::PageTransitionCoreTypeIs(transition,
ui::PAGE_TRANSITION_AUTO_BOOKMARK) ||
ui::PageTransitionCoreTypeIs(transition,
ui::PAGE_TRANSITION_KEYWORD_GENERATED);
ui::PAGE_TRANSITION_KEYWORD_GENERATED) ||
ui::PageTransitionCoreTypeIs(transition,
ui::PAGE_TRANSITION_AUTO_TOPLEVEL);
}
} // namespace
......
......@@ -1083,10 +1083,10 @@ TEST_F(SiteEngagementServiceTest, NavigationAccumulation) {
ui::PAGE_TRANSITION_AUTO_BOOKMARK);
NavigateWithTransitionAndExpectHigherScore(
service, url, ui::PAGE_TRANSITION_KEYWORD_GENERATED);
NavigateWithTransitionAndExpectHigherScore(service, url,
ui::PAGE_TRANSITION_AUTO_TOPLEVEL);
// Other transition types should not accumulate engagement.
NavigateWithTransitionAndExpectEqualScore(service, url,
ui::PAGE_TRANSITION_AUTO_TOPLEVEL);
NavigateWithTransitionAndExpectEqualScore(service, url,
ui::PAGE_TRANSITION_LINK);
NavigateWithTransitionAndExpectEqualScore(service, url,
......
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