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). |
Bernhard Bauer
2016/09/14 13:53:08
What does "Most Visited" here mean? Top Sites? Bec
Marc Treib
2016/09/14 13:55:05
Right, the formulation could be clearer. "Such ent
|
+ if (!has_redirects && |
+ 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) && |