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

Unified Diff: chrome/browser/ui/app_list/app_list_syncable_service.h

Issue 77773002: Ensure the ExtensionSystem is ready before initializing an ExtensionAppModelBuilder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: System -> Service Created 7 years, 1 month 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/ui/app_list/app_list_syncable_service.h
diff --git a/chrome/browser/ui/app_list/app_list_syncable_service.h b/chrome/browser/ui/app_list/app_list_syncable_service.h
index 0bd7e266ec59dd0cb88ee335d6f0635cc434da38..52ec42349167473b322f9fbce5e925aa20224d38 100644
--- a/chrome/browser/ui/app_list/app_list_syncable_service.h
+++ b/chrome/browser/ui/app_list/app_list_syncable_service.h
@@ -7,25 +7,41 @@
#include "base/memory/scoped_ptr.h"
#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
class ExtensionAppModelBuilder;
+class ExtensionService;
class Profile;
namespace app_list {
class AppListModel;
-// Keyed Service that owns, stores, and syncs an AppListModel for a profile.
+// Keyed Service that owns, stores, and syncs an AppListModel for an
+// ExtensionSystem and corresponding profile.
// TODO(stevenjb): Integrate with Sync. crbug.com/305024.
-class AppListSyncableService : public BrowserContextKeyedService {
+class AppListSyncableService : public BrowserContextKeyedService,
+ public content::NotificationObserver {
public:
- explicit AppListSyncableService(Profile* profile);
+ // Create an empty model. Then, if |extension_service| is non-NULL and ready,
+ // populate it. Otherwise populate the model once extensions become ready.
+ AppListSyncableService(Profile* profile, ExtensionService* extension_service);
+
virtual ~AppListSyncableService();
AppListModel* model() { return model_.get(); }
private:
+ void BuildModel();
+
+ // content::NotificationObserver:
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
Profile* profile_;
+ content::NotificationRegistrar registrar_;
scoped_ptr<AppListModel> model_;
scoped_ptr<ExtensionAppModelBuilder> apps_builder_;
« no previous file with comments | « chrome/browser/ui/app_list/app_list_controller_delegate.cc ('k') | chrome/browser/ui/app_list/app_list_syncable_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698