#include "base/observer_list.h"
#include "base/timer/timer.h"
#include "chrome/browser/sync/profile_sync_service_observer.h"
-#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
+#include "components/keyed_service/core/keyed_service.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "extensions/browser/extension_registry_observer.h"
class AppSyncUIStateObserver;
class Profile;
class ProfileSyncService;
+namespace extensions {
+class ExtensionRegistry;
+}
+
// AppSyncUIState watches app sync and installation and change its state
// accordingly. Its status is for UI display only. It only watches for new
// normal user profile (i.e. it does not watch for guest profile or exsiting
// user profile) and lasts for at the most 1 minute.
-class AppSyncUIState : public BrowserContextKeyedService,
- public content::NotificationObserver,
- public ProfileSyncServiceObserver {
+class AppSyncUIState : public KeyedService,
+ public ProfileSyncServiceObserver,
+ public extensions::ExtensionRegistryObserver {
public:
enum Status {
STATUS_NORMAL,
// Invoked when |max_syncing_status_timer_| fires.
void OnMaxSyncingTimer();
- // content::NotificationObserver overrides:
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
// ProfileSyncServiceObserver overrides:
virtual void OnStateChanged() OVERRIDE;
- content::NotificationRegistrar registrar_;
+ // extensions::ExtensionRegistryObserver overrides:
+ virtual void OnExtensionLoaded(
+ content::BrowserContext* browser_context,
+ const extensions::Extension* extension) OVERRIDE;
Profile* profile_;
ProfileSyncService* sync_service_;
Status status_;
ObserverList<AppSyncUIStateObserver> observers_;
+ extensions::ExtensionRegistry* extension_registry_;
+
DISALLOW_COPY_AND_ASSIGN(AppSyncUIState);
};