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

Unified Diff: components/history/core/browser/top_sites_impl.h

Issue 1100763002: Inject CanAddURLToHistory into TopSitesImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefs
Patch Set: Fix error introduced during rebase Created 5 years, 8 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/top_sites_impl.h
diff --git a/chrome/browser/history/top_sites_impl.h b/components/history/core/browser/top_sites_impl.h
similarity index 95%
rename from chrome/browser/history/top_sites_impl.h
rename to components/history/core/browser/top_sites_impl.h
index 60e40b66c45fe1b093714569e26c73a0d53f4d08..e28ceb59d4c68e00fc9c489ef98a1a1bcca2dcbe 100644
--- a/chrome/browser/history/top_sites_impl.h
+++ b/components/history/core/browser/top_sites_impl.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_HISTORY_TOP_SITES_IMPL_H_
-#define CHROME_BROWSER_HISTORY_TOP_SITES_IMPL_H_
+#ifndef COMPONENTS_HISTORY_CORE_BROWSER_TOP_SITES_IMPL_H_
+#define COMPONENTS_HISTORY_CORE_BROWSER_TOP_SITES_IMPL_H_
#include <list>
#include <set>
@@ -53,10 +53,15 @@ class TopSitesImplTest;
// db using TopSitesBackend.
class TopSitesImpl : public TopSites, public HistoryServiceObserver {
public:
+ // Called to check whether an URL can be added to the history. Must be
+ // callable multiple time and during the whole lifetime of TopSitesImpl.
+ using CanAddURLToHistoryFn = base::Callback<bool(const GURL&)>;
+
TopSitesImpl(PrefService* pref_service,
HistoryService* history_service,
const char* blacklist_pref_name,
- const PrepopulatedPageList& prepopulated_pages);
+ const PrepopulatedPageList& prepopulated_pages,
+ const CanAddURLToHistoryFn& can_add_url_to_history);
// Initializes TopSitesImpl.
void Init(const base::FilePath& db_name,
@@ -294,6 +299,9 @@ class TopSitesImpl : public TopSites, public HistoryServiceObserver {
// must outlive TopSitesImpl.
HistoryService* history_service_;
+ // Can URL be added to the history?
+ CanAddURLToHistoryFn can_add_url_to_history_;
+
// Are we loaded?
bool loaded_;
@@ -309,4 +317,4 @@ class TopSitesImpl : public TopSites, public HistoryServiceObserver {
} // namespace history
-#endif // CHROME_BROWSER_HISTORY_TOP_SITES_IMPL_H_
+#endif // COMPONENTS_HISTORY_CORE_BROWSER_TOP_SITES_IMPL_H_
« no previous file with comments | « components/history/core/browser/thumbnail_database.cc ('k') | components/history/core/browser/top_sites_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698