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

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

Issue 271393003: Use ExtensionRegistryObserver instead of deprecated extension notification from autocomplete (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: colon to period Created 6 years, 7 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
Index: chrome/browser/autocomplete/shortcuts_backend.h
diff --git a/chrome/browser/autocomplete/shortcuts_backend.h b/chrome/browser/autocomplete/shortcuts_backend.h
index 64f3bcc5f6434dd9cf7c8990fe3120b77bcec31b..5729cea26892466adfe783ed94eea01892064267 100644
--- a/chrome/browser/autocomplete/shortcuts_backend.h
+++ b/chrome/browser/autocomplete/shortcuts_backend.h
@@ -14,6 +14,7 @@
#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"
@@ -22,10 +23,15 @@
#include "components/keyed_service/content/refcounted_browser_context_keyed_service.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "extensions/browser/extension_registry_observer.h"
#include "url/gurl.h"
class Profile;
+namespace extensions {
+class ExtensionRegistry;
+}
+
namespace history {
class ShortcutsDatabase;
}; // namespace history
@@ -33,7 +39,8 @@ class ShortcutsDatabase;
// This class manages the shortcut provider backend - access to database on the
// db thread, etc.
class ShortcutsBackend : public RefcountedBrowserContextKeyedService,
- public content::NotificationObserver {
+ public content::NotificationObserver,
+ public extensions::ExtensionRegistryObserver {
public:
typedef std::multimap<base::string16,
const history::ShortcutsDatabase::Shortcut> ShortcutMap;
@@ -104,6 +111,12 @@ class ShortcutsBackend : public RefcountedBrowserContextKeyedService,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
+ // extensions::ExtensionRegistryObserver:
+ virtual void OnExtensionUnloaded(
+ content::BrowserContext* browser_context,
+ const extensions::Extension* extension,
+ extensions::UnloadedExtensionInfo::Reason reason) OVERRIDE;
+
// Internal initialization of the back-end. Posted by Init() to the DB thread.
// On completion posts InitCompleted() back to UI thread.
void InitInternal();
@@ -145,6 +158,10 @@ class ShortcutsBackend : public RefcountedBrowserContextKeyedService,
content::NotificationRegistrar notification_registrar_;
+ ScopedObserver<extensions::ExtensionRegistry,
+ extensions::ExtensionRegistryObserver>
+ extension_registry_observer_;
+
// For some unit-test only.
bool no_db_access_;
« no previous file with comments | « chrome/browser/autocomplete/extension_app_provider_unittest.cc ('k') | chrome/browser/autocomplete/shortcuts_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698