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

Unified Diff: chrome/browser/autocomplete/shortcuts_backend.h

Issue 773103004: Remove NOTIFICATION_HISTORY_URLS_DELETED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed styling issue Created 6 years 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
Index: chrome/browser/autocomplete/shortcuts_backend.h
diff --git a/chrome/browser/autocomplete/shortcuts_backend.h b/chrome/browser/autocomplete/shortcuts_backend.h
index 88d82ddbd92243edf0b0bc1f565ae9e5711c23fa..dac9ece41c80773c888ec945eb2d45c7a67c0d01 100644
--- a/chrome/browser/autocomplete/shortcuts_backend.h
+++ b/chrome/browser/autocomplete/shortcuts_backend.h
@@ -14,10 +14,12 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
+#include "base/scoped_observer.h"
#include "base/strings/string16.h"
#include "base/synchronization/lock.h"
#include "base/time/time.h"
#include "chrome/browser/history/shortcuts_database.h"
+#include "components/history/core/browser/history_service_observer.h"
#include "components/keyed_service/core/refcounted_keyed_service.h"
#include "components/omnibox/autocomplete_match.h"
#include "content/public/browser/notification_observer.h"
@@ -33,7 +35,8 @@ class ShortcutsDatabase;
// This class manages the shortcut provider backend - access to database on the
// db thread, etc.
class ShortcutsBackend : public RefcountedKeyedService,
- public content::NotificationObserver {
+ public content::NotificationObserver,
+ public history::HistoryServiceObserver {
public:
typedef std::multimap<base::string16,
const history::ShortcutsDatabase::Shortcut> ShortcutMap;
@@ -128,6 +131,13 @@ class ShortcutsBackend : public RefcountedKeyedService,
// Deletes all of the shortcuts.
bool DeleteAllShortcuts();
+ // history::HistoryServiceObserver:
Peter Kasting 2014/12/11 19:59:35 Nit: Please move this to just below the private No
nshaik 2014/12/12 05:40:56 Done.
+ void OnURLsDeleted(HistoryService* history_service,
+ bool all_history,
+ bool expired,
+ const history::URLRows& deleted_rows,
+ const std::set<GURL>& favicon_urls) override;
+
Profile* profile_;
CurrentState current_state_;
ObserverList<ShortcutsBackendObserver> observer_list_;
@@ -148,6 +158,9 @@ class ShortcutsBackend : public RefcountedKeyedService,
// For some unit-test only.
bool no_db_access_;
+ ScopedObserver<HistoryService, HistoryServiceObserver>
Peter Kasting 2014/12/11 19:59:35 Nit: I would probably move this above the |no_db_a
nshaik 2014/12/12 05:40:56 Done.
+ history_service_observer_;
+
DISALLOW_COPY_AND_ASSIGN(ShortcutsBackend);
};

Powered by Google App Engine
This is Rietveld 408576698