Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: chrome/browser/resources/local_ntp/most_visited_util.js

Issue 274143002: Temporarily Making Server-Side NTP Recommendations Use LINK Transition Instead of AUTO_BOOKMARK (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/local_ntp/most_visited_util.js
diff --git a/chrome/browser/resources/local_ntp/most_visited_util.js b/chrome/browser/resources/local_ntp/most_visited_util.js
index cf6b7ffa498fc4e85c4713f53419768c622bfdfe..5c2b8723b1f99fa7bec04581797b52bb1e97d3be 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 <a> normally, so transition type would be LINK.
});
return link;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698