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

Unified Diff: chrome/browser/ui/webui/browsing_history_handler.h

Issue 2263613002: Make BrowsingDataHandler observe WebHistoryService deletions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved comments inside 'if'. Created 4 years, 4 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 | « no previous file | chrome/browser/ui/webui/browsing_history_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/browsing_history_handler.h
diff --git a/chrome/browser/ui/webui/browsing_history_handler.h b/chrome/browser/ui/webui/browsing_history_handler.h
index 8c297d55e08cdf73dbf6c066873f311388aa76c9..74ce76a903ce9dcd8a98dc24edbb643c65a39560 100644
--- a/chrome/browser/ui/webui/browsing_history_handler.h
+++ b/chrome/browser/ui/webui/browsing_history_handler.h
@@ -20,6 +20,8 @@
#include "components/history/core/browser/history_service_observer.h"
#include "components/history/core/browser/url_row.h"
#include "components/history/core/browser/web_history_service.h"
+#include "components/history/core/browser/web_history_service_observer.h"
+#include "components/sync/driver/sync_service_observer.h"
#include "content/public/browser/web_ui_message_handler.h"
#include "url/gurl.h"
@@ -36,9 +38,15 @@ struct QueryOptions;
class QueryResults;
}
+namespace sync_driver {
+class SyncServiceObserver;
+}
+
// The handler for Javascript messages related to the "history" view.
class BrowsingHistoryHandler : public content::WebUIMessageHandler,
- public history::HistoryServiceObserver {
+ public history::HistoryServiceObserver,
+ public history::WebHistoryServiceObserver,
+ public sync_driver::SyncServiceObserver {
public:
// Represents a history entry to be shown to the user, representing either
// a local or remote visit. A single entry can represent multiple visits,
@@ -106,6 +114,9 @@ class BrowsingHistoryHandler : public content::WebUIMessageHandler,
// WebUIMessageHandler implementation.
void RegisterMessages() override;
+ // SyncServiceObserver implementation.
+ void OnStateChanged() override;
+
// Handler for the "queryHistory" message.
void HandleQueryHistory(const base::ListValue* args);
@@ -189,6 +200,9 @@ class BrowsingHistoryHandler : public content::WebUIMessageHandler,
const history::URLRows& deleted_rows,
const std::set<GURL>& favicon_urls) override;
+ // history::WebHistoryServiceObserver:
+ void OnWebHistoryDeleted() override;
+
// Tracker for search requests to the history service.
base::CancelableTaskTracker query_task_tracker_;
@@ -217,9 +231,18 @@ class BrowsingHistoryHandler : public content::WebUIMessageHandler,
// Timer used to implement a timeout on a Web History response.
base::OneShotTimer web_history_timer_;
+ // HistoryService (local history) observer.
ScopedObserver<history::HistoryService, history::HistoryServiceObserver>
history_service_observer_;
+ // WebHistoryService (synced history) observer.
+ ScopedObserver<history::WebHistoryService, history::WebHistoryServiceObserver>
+ web_history_service_observer_;
+
+ // ProfileSyncService observer listens to late initialization of history sync.
+ ScopedObserver<ProfileSyncService, sync_driver::SyncServiceObserver>
+ sync_service_observer_;
+
// Whether the last call to Web History returned synced results.
bool has_synced_results_;
« no previous file with comments | « no previous file | chrome/browser/ui/webui/browsing_history_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698