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

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

Issue 773103004: Remove NOTIFICATION_HISTORY_URLS_DELETED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to tip Created 5 years, 11 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/ui/cocoa/history_menu_bridge.mm ('k') | chrome/browser/ui/webui/history_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/history_ui.h
diff --git a/chrome/browser/ui/webui/history_ui.h b/chrome/browser/ui/webui/history_ui.h
index 2048409ded57740a8bd407711a3c9d1137506813..cb880b9a87390dd31ddd64890748c5294ee21595 100644
--- a/chrome/browser/ui/webui/history_ui.h
+++ b/chrome/browser/ui/webui/history_ui.h
@@ -8,16 +8,17 @@
#include <string>
#include "base/memory/weak_ptr.h"
+#include "base/scoped_observer.h"
#include "base/strings/string16.h"
#include "base/task/cancelable_task_tracker.h"
#include "base/timer/timer.h"
#include "base/values.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/web_history_service.h"
-#include "content/public/browser/notification_registrar.h"
+#include "components/history/core/browser/history_service_observer.h"
#include "content/public/browser/web_ui_controller.h"
#include "content/public/browser/web_ui_message_handler.h"
+class HistoryService;
class ProfileSyncService;
class SupervisedUserService;
@@ -27,7 +28,7 @@ class BookmarkModel;
// The handler for Javascript messages related to the "history" view.
class BrowsingHistoryHandler : public content::WebUIMessageHandler,
- public content::NotificationObserver {
+ public history::HistoryServiceObserver {
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,
@@ -109,11 +110,6 @@ class BrowsingHistoryHandler : public content::WebUIMessageHandler,
// Handler for "removeBookmark" message.
void HandleRemoveBookmark(const base::ListValue* args);
- // content::NotificationObserver implementation.
- void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) override;
-
// Merges duplicate entries from the query results, only retaining the most
// recent visit to a URL on a particular day. That visit contains the
// timestamps of the other visits.
@@ -173,7 +169,12 @@ class BrowsingHistoryHandler : public content::WebUIMessageHandler,
// kAcceptLanguages pref value.
std::string GetAcceptLanguages() const;
- content::NotificationRegistrar registrar_;
+ // history::HistoryServiceObserver:
+ void OnURLsDeleted(HistoryService* history_service,
+ bool all_history,
+ bool expired,
+ const history::URLRows& deleted_rows,
+ const std::set<GURL>& favicon_urls) override;
// Tracker for search requests to the history service.
base::CancelableTaskTracker query_task_tracker_;
@@ -203,6 +204,9 @@ class BrowsingHistoryHandler : public content::WebUIMessageHandler,
// Timer used to implement a timeout on a Web History response.
base::OneShotTimer<BrowsingHistoryHandler> web_history_timer_;
+ ScopedObserver<HistoryService, HistoryServiceObserver>
+ history_service_observer_;
+
base::WeakPtrFactory<BrowsingHistoryHandler> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(BrowsingHistoryHandler);
« no previous file with comments | « chrome/browser/ui/cocoa/history_menu_bridge.mm ('k') | chrome/browser/ui/webui/history_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698