Commit 6ba165ef authored by huangs@chromium.org's avatar huangs@chromium.org

Temporarily Making Server-Side NTP Recommendations Use LINK Transition Instead of AUTO_BOOKMARK

Previously "NTP clicks" (i.e., navigations on NTP suggestions) use AUTO_BOOKMARK transition type. Eventually we want to create a new transition type, but right now AUTO_BOOKMARK ambiguates NTP clicks with bookmark usage.  To prevent this, this CL make NTP clicks for *server-side suggestions* a LINK transition type.  This partially reverts the changes for https://chromiumcodereview.appspot.com/178253008/ .

Important: NTP clicks for client-side recommendations (i.e., Most Visited) remains at AUTO_BOOKMARK, as to not interfere with existing behavior in chain start detection.

BUG=
NOTRY=true

Review URL: https://codereview.chromium.org/274143002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269658 0039d316-1c4b-4281-b951-d872f2087c98
parent 563dc476
......@@ -121,13 +121,17 @@ function createMostVisitedLink(params, href, title, text, provider) {
// working (those with schemes different from http and https). Therefore,
// navigateContentWindow is being used in order to get all schemes working.
link.addEventListener('click', function handleNavigation(e) {
e.preventDefault();
var ntpApiHandle = chrome.embeddedSearch.newTabPage;
if ('pos' in params && isFinite(params.pos)) {
ntpApiHandle.logMostVisitedNavigation(parseInt(params.pos, 10),
provider || '');
}
ntpApiHandle.navigateContentWindow(href, getDispositionFromEvent(e));
var isServerSuggestion = 'url' in params;
if (!isServerSuggestion) {
e.preventDefault();
ntpApiHandle.navigateContentWindow(href, getDispositionFromEvent(e));
}
// Else follow <a> normally, so transition type would be LINK.
});
return link;
......
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