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

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

Issue 631253002: Refactor sending NOTIFICATION_HISTORY_URL_VISITED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests on Android 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
« no previous file with comments | « chrome/browser/history/in_memory_history_backend.cc ('k') | chrome/browser/history/in_memory_url_index.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/in_memory_url_index.h
diff --git a/chrome/browser/history/in_memory_url_index.h b/chrome/browser/history/in_memory_url_index.h
index cff3fca3b30f4efaadf4bc781624990602e30308..2f0690e51672cbf734adb247191e4eba890ffd48 100644
--- a/chrome/browser/history/in_memory_url_index.h
+++ b/chrome/browser/history/in_memory_url_index.h
@@ -21,11 +21,13 @@
#include "chrome/browser/history/history_db_task.h"
#include "chrome/browser/history/in_memory_url_index_types.h"
#include "chrome/browser/history/scored_history_match.h"
+#include "components/history/core/browser/history_service_observer.h"
#include "components/history/core/browser/history_types.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "sql/connection.h"
+class HistoryService;
class HistoryQuickProviderTest;
class Profile;
@@ -67,7 +69,8 @@ struct URLVisitedDetails;
// will eliminate such words except in the case where a single character
// is being searched on and which character occurs as the second char16 of a
// multi-char16 instance.
-class InMemoryURLIndex : public content::NotificationObserver,
+class InMemoryURLIndex : public HistoryServiceObserver,
+ public content::NotificationObserver,
public base::SupportsWeakPtr<InMemoryURLIndex> {
public:
// Defines an abstract class which is notified upon completion of restoring
@@ -100,6 +103,7 @@ class InMemoryURLIndex : public content::NotificationObserver,
// journals will be stored. |languages| gives a list of language encodings by
// which URLs and omnibox searches are broken down into words and characters.
InMemoryURLIndex(Profile* profile,
+ HistoryService* history_service,
const base::FilePath& history_dir,
const std::string& languages,
HistoryClient* client);
@@ -236,8 +240,14 @@ class InMemoryURLIndex : public content::NotificationObserver,
const content::NotificationSource& source,
const content::NotificationDetails& details) override;
+ // HistoryServiceObserver:
+ virtual void OnURLVisited(HistoryService* history_service,
+ ui::PageTransition transition,
+ const URLRow& row,
+ const RedirectList& redirects,
+ base::Time visit_time) OVERRIDE;
+
// Notification handlers.
- void OnURLVisited(const URLVisitedDetails* details);
void OnURLsModified(const URLsModifiedDetails* details);
void OnURLsDeleted(const URLsDeletedDetails* details);
@@ -261,6 +271,7 @@ class InMemoryURLIndex : public content::NotificationObserver,
// The profile, may be null when testing.
Profile* profile_;
+ HistoryService* history_service_;
// The HistoryClient; may be NULL when testing.
HistoryClient* history_client_;
« no previous file with comments | « chrome/browser/history/in_memory_history_backend.cc ('k') | chrome/browser/history/in_memory_url_index.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698