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

Unified Diff: chrome/browser/extensions/api/history/history_api.h

Issue 651193002: Remove NOTIFICATION_HISTORY_URL_VISITED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@373326.2
Patch Set: Address comments 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/chrome_notification_types.h ('k') | chrome/browser/extensions/api/history/history_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/history/history_api.h
diff --git a/chrome/browser/extensions/api/history/history_api.h b/chrome/browser/extensions/api/history/history_api.h
index 660f96d506b25293189870e45b64e5f2fe0007ef..1f89660a422122d7b8b3781c44bc3aafb7f79151 100644
--- a/chrome/browser/extensions/api/history/history_api.h
+++ b/chrome/browser/extensions/api/history/history_api.h
@@ -9,11 +9,13 @@
#include <vector>
#include "base/compiler_specific.h"
+#include "base/scoped_observer.h"
#include "base/task/cancelable_task_tracker.h"
#include "chrome/browser/extensions/chrome_extension_function.h"
#include "chrome/browser/history/history_notifications.h"
#include "chrome/browser/history/history_service.h"
#include "chrome/common/extensions/api/history.h"
+#include "components/history/core/browser/history_service_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "extensions/browser/browser_context_keyed_api_factory.h"
#include "extensions/browser/event_router.h"
@@ -26,9 +28,10 @@ namespace extensions {
// Observes History service and routes the notifications as events to the
// extension system.
-class HistoryEventRouter : public content::NotificationObserver {
+class HistoryEventRouter : public content::NotificationObserver,
+ public history::HistoryServiceObserver {
public:
- explicit HistoryEventRouter(Profile* profile);
+ HistoryEventRouter(Profile* profile, HistoryService* history_service);
virtual ~HistoryEventRouter();
private:
@@ -37,8 +40,12 @@ class HistoryEventRouter : public content::NotificationObserver {
const content::NotificationSource& source,
const content::NotificationDetails& details) override;
- void HistoryUrlVisited(Profile* profile,
- const history::URLVisitedDetails* details);
+ // history::HistoryServiceObserver.
+ virtual void OnURLVisited(HistoryService* history_service,
+ ui::PageTransition transition,
+ const history::URLRow& row,
+ const history::RedirectList& redirects,
+ base::Time visit_time) override;
void HistoryUrlsRemoved(Profile* profile,
const history::URLsDeletedDetails* details);
@@ -49,6 +56,9 @@ class HistoryEventRouter : public content::NotificationObserver {
// Used for tracking registrations to history service notifications.
content::NotificationRegistrar registrar_;
+ Profile* profile_;
+ ScopedObserver<HistoryService, HistoryServiceObserver>
+ history_service_observer_;
DISALLOW_COPY_AND_ASSIGN(HistoryEventRouter);
};
« no previous file with comments | « chrome/browser/chrome_notification_types.h ('k') | chrome/browser/extensions/api/history/history_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698