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

Unified Diff: components/history/core/browser/history_backend.cc

Issue 2342453003: [NTP] Fix article suggestion clicks contributing to Most Visited tiles (Closed)
Patch Set: Added TODO as suggested. Created 4 years, 3 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
Index: components/history/core/browser/history_backend.cc
diff --git a/components/history/core/browser/history_backend.cc b/components/history/core/browser/history_backend.cc
index ff46dd8c34b1032a78050d742cfe70eacf79389e..aa9e51d406fb4731216110bcefb28bf99c4b13be 100644
--- a/components/history/core/browser/history_backend.cc
+++ b/components/history/core/browser/history_backend.cc
@@ -493,10 +493,22 @@ void HistoryBackend::AddPage(const HistoryAddPageArgs& request) {
bool is_keyword_generated = ui::PageTransitionCoreTypeIs(
request_transition, ui::PAGE_TRANSITION_KEYWORD_GENERATED);
+ bool has_redirects = request.redirects.size() > 1;
+
+ // data: scheme is sometimes used in combination with AUTO_BOOKMARK to fake a
+ // redirect as way to make sure it doesn't show up in most visited. Such
+ // entries should be ignored for the purpose of history (including omnibox
+ // autocomplete and most visited).
+ if (!has_redirects &&
sky 2016/09/14 18:01:51 Wouldn't this mean the page won't show up in histo
mastiz 2016/09/14 18:10:18 The article itself (redirectee) gets listed in his
sky 2016/09/14 18:17:49 I believe this change would make it so data urls a
mastiz 2016/09/14 18:22:02 More specifically, data URLs with AUTO_BOOKMARK (n
mastiz 2016/09/14 18:40:47 Also, would it be any better if we left FROM_ADDRE
+ ui::PageTransitionCoreTypeIs(request_transition,
+ ui::PAGE_TRANSITION_AUTO_BOOKMARK) &&
+ request.url.SchemeIs(url::kDataScheme)) {
+ return;
+ }
+
// If the user is navigating to a not-previously-typed intranet hostname,
// change the transition to TYPED so that the omnibox will learn that this is
// a known host.
- bool has_redirects = request.redirects.size() > 1;
if (ui::PageTransitionIsMainFrame(request_transition) &&
!ui::PageTransitionCoreTypeIs(request_transition,
ui::PAGE_TRANSITION_TYPED) &&

Powered by Google App Engine
This is Rietveld 408576698