Chromium Code Reviews| Index: chrome/browser/history/history_tab_helper.cc |
| diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/history/history_tab_helper.cc |
| index c633e3c9ad1b05c83343a5e8428ec84a4122faf0..a3f1a8a7693fde8b6cfb94269d3ad4ab095d8bdc 100644 |
| --- a/chrome/browser/history/history_tab_helper.cc |
| +++ b/chrome/browser/history/history_tab_helper.cc |
| @@ -30,6 +30,14 @@ using content::WebContents; |
| DEFINE_WEB_CONTENTS_USER_DATA_KEY(HistoryTabHelper); |
| +namespace { |
| + |
| +// Referrer used for clicks on article suggestions on the NTP. |
| +const char kChromeContentSuggestionsReferrer[] = |
| + "https://www.googleapis.com/auth/chrome-content-suggestions"; |
| + |
| +} // namespace |
| + |
| HistoryTabHelper::HistoryTabHelper(WebContents* web_contents) |
| : content::WebContentsObserver(web_contents), |
| received_page_title_(false) { |
| @@ -58,10 +66,13 @@ HistoryTabHelper::CreateHistoryAddPageArgs( |
| bool did_replace_entry, |
| int nav_entry_id, |
| const content::FrameNavigateParams& params) { |
| + const bool skip_for_ntp_most_visited = |
|
sky
2016/09/15 22:56:10
Please document why we want this skipped.
mastiz
2016/09/16 08:42:09
Done.
|
| + params.referrer.url == GURL(kChromeContentSuggestionsReferrer); |
| + |
| history::HistoryAddPageArgs add_page_args( |
| params.url, timestamp, history::ContextIDForWebContents(web_contents()), |
| nav_entry_id, params.referrer.url, params.redirects, params.transition, |
| - history::SOURCE_BROWSED, did_replace_entry); |
| + history::SOURCE_BROWSED, did_replace_entry, skip_for_ntp_most_visited); |
| if (ui::PageTransitionIsMainFrame(params.transition) && |
| virtual_url != params.url) { |
| // Hack on the "virtual" URL so that it will appear in history. For some |