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..26b4193ad84a4b3358419d5b8ae4a95143341be9 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; |
+ // Overridden from extensions::ExtensionRegistryObserver. |
Peter Kasting
2014/05/12 19:46:55
Nit: File style seems to be "extensions::Extension
limasdf
2014/05/13 14:38:44
Done.
|
+ 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,11 @@ class ShortcutsBackend : public RefcountedBrowserContextKeyedService, |
content::NotificationRegistrar notification_registrar_; |
+ // Listen to extension load, unload notifications. |
Peter Kasting
2014/05/12 19:46:55
Remove this comment; it's both inaccurate (you're
limasdf
2014/05/13 14:38:44
Done.
|
+ ScopedObserver<extensions::ExtensionRegistry, |
+ extensions::ExtensionRegistryObserver> |
+ extension_registry_observer_; |
+ |
// For some unit-test only. |
bool no_db_access_; |