From 6ba165ef25c50d1ae582e8448768ef64a4307ddf Mon Sep 17 00:00:00 2001 From: "huangs@chromium.org" Date: Sun, 11 May 2014 00:46:33 +0000 Subject: [PATCH] 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 --- chrome/browser/resources/local_ntp/most_visited_util.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/chrome/browser/resources/local_ntp/most_visited_util.js b/chrome/browser/resources/local_ntp/most_visited_util.js index cf6b7ffa498f..5c2b8723b1f9 100644 --- a/chrome/browser/resources/local_ntp/most_visited_util.js +++ b/chrome/browser/resources/local_ntp/most_visited_util.js @@ -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 normally, so transition type would be LINK. }); return link; -- 2.11.4.GIT