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_; |