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

Unified Diff: chrome/browser/history/top_sites_impl.cc

Issue 971423002: Abstract code filtering URLs added to the history (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@keyed-service
Patch Set: Created 5 years, 10 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: chrome/browser/history/top_sites_impl.cc
diff --git a/chrome/browser/history/top_sites_impl.cc b/chrome/browser/history/top_sites_impl.cc
index 70dc274ac729af2ff8c3fa4d19dd5b50be52dbe9..94f365ba1a848463ecf4b5da51573575ad0057e1 100644
--- a/chrome/browser/history/top_sites_impl.cc
+++ b/chrome/browser/history/top_sites_impl.cc
@@ -24,6 +24,7 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/history/history_backend.h"
#include "chrome/browser/history/history_service_factory.h"
+#include "chrome/browser/history/history_utils.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
#include "components/history/core/browser/history_db_task.h"
@@ -149,7 +150,7 @@ bool TopSitesImpl::SetPageThumbnail(const GURL& url,
}
}
- if (!HistoryService::CanAddURL(url))
+ if (!CanAddURLToHistory(url))
return false; // It's not a real webpage.
scoped_refptr<base::RefCountedBytes> thumbnail_data;
@@ -188,7 +189,7 @@ bool TopSitesImpl::SetPageThumbnailToJPEGBytes(
}
}
- if (!HistoryService::CanAddURL(url))
+ if (!CanAddURLToHistory(url))
return false; // It's not a real webpage.
if (add_temp_thumbnail) {
@@ -743,7 +744,7 @@ void TopSitesImpl::Observe(int type,
if (!load_details)
return;
const GURL& url = load_details->entry->GetURL();
- if (!cache_->IsKnownURL(url) && HistoryService::CanAddURL(url)) {
+ if (!cache_->IsKnownURL(url) && CanAddURLToHistory(url)) {
// To avoid slamming history we throttle requests when the url updates.
// To do otherwise negatively impacts perf tests.
RestartQueryForTopSitesTimer(GetUpdateDelay());

Powered by Google App Engine
This is Rietveld 408576698