| 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..dd2a7a5c9c65c24d5a6dbb01e6aa08d42f3e5bd8 100644
|
| --- a/chrome/browser/ui/webui/browsing_history_handler.h
|
| +++ b/chrome/browser/ui/webui/browsing_history_handler.h
|
| @@ -20,6 +20,7 @@
|
| #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/sync/driver/sync_service_observer.h"
|
| #include "content/public/browser/web_ui_message_handler.h"
|
| #include "url/gurl.h"
|
|
|
| @@ -36,9 +37,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::WebHistoryService::Observer,
|
| + 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 +113,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 +199,9 @@ class BrowsingHistoryHandler : public content::WebUIMessageHandler,
|
| const history::URLRows& deleted_rows,
|
| const std::set<GURL>& favicon_urls) override;
|
|
|
| + // history::WebHistoryService::Observer:
|
| + void OnWebHistoryDeleted() override;
|
| +
|
| // Tracker for search requests to the history service.
|
| base::CancelableTaskTracker query_task_tracker_;
|
|
|
| @@ -217,9 +230,19 @@ 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::WebHistoryService::Observer>
|
| + 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_;
|
|
|
|
|