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

Unified Diff: chrome/browser/history/in_memory_history_backend.h

Issue 631253002: Refactor sending NOTIFICATION_HISTORY_URL_VISITED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/in_memory_history_backend.h
diff --git a/chrome/browser/history/in_memory_history_backend.h b/chrome/browser/history/in_memory_history_backend.h
index 846c9195e669aeeb0003063ab99577ec6ca7065d..97fa39522fee400d77a5a794ed31c1a030bfdec8 100644
--- a/chrome/browser/history/in_memory_history_backend.h
+++ b/chrome/browser/history/in_memory_history_backend.h
@@ -25,10 +25,12 @@
#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
+#include "components/history/core/browser/history_service_observer.h"
#include "components/history/core/browser/keyword_id.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+class HistoryService;
class Profile;
namespace base {
@@ -45,7 +47,8 @@ class URLRow;
struct URLsDeletedDetails;
struct URLsModifiedDetails;
-class InMemoryHistoryBackend : public content::NotificationObserver {
+class InMemoryHistoryBackend : public HistoryServiceObserver,
+ public content::NotificationObserver {
public:
InMemoryHistoryBackend();
virtual ~InMemoryHistoryBackend();
@@ -57,7 +60,8 @@ class InMemoryHistoryBackend : public content::NotificationObserver {
// Does initialization work when this object is attached to the history
// system on the main thread. The argument is the profile with which the
// attached history service is under.
- void AttachToHistoryService(Profile* profile);
+ void AttachToHistoryService(Profile* profile,
+ HistoryService* history_service);
// Deletes all search terms for the specified keyword.
void DeleteAllSearchTermsForKeyword(KeywordID keyword_id);
@@ -69,6 +73,12 @@ class InMemoryHistoryBackend : public content::NotificationObserver {
return db_.get();
}
+ // HistoryServiceObserver:
+ virtual void OnURLVisited(ui::PageTransition transition,
+ const URLRow& row,
+ const RedirectList& redirects,
+ const base::Time& visit_time) OVERRIDE;
+
// Notification callback.
virtual void Observe(int type,
const content::NotificationSource& source,
@@ -96,6 +106,7 @@ class InMemoryHistoryBackend : public content::NotificationObserver {
// The profile that this object is attached. May be NULL before
// initialization.
Profile* profile_;
+ HistoryService* history_service_;
DISALLOW_COPY_AND_ASSIGN(InMemoryHistoryBackend);
};

Powered by Google App Engine
This is Rietveld 408576698