OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_SYNCABLE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_SYNCABLE_SERVICE_H_ |
6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_SYNCABLE_SERVICE_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_SYNCABLE_SERVICE_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" | 9 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" |
| 10 #include "content/public/browser/notification_observer.h" |
| 11 #include "content/public/browser/notification_registrar.h" |
10 | 12 |
11 class ExtensionAppModelBuilder; | 13 class ExtensionAppModelBuilder; |
12 class Profile; | 14 class Profile; |
13 | 15 |
14 namespace app_list { | 16 namespace app_list { |
15 | 17 |
16 class AppListModel; | 18 class AppListModel; |
17 | 19 |
18 // Keyed Service that owns, stores, and syncs an AppListModel for a profile. | 20 // Keyed Service that owns, stores, and syncs an AppListModel for a profile. |
19 // TODO(stevenjb): Integrate with Sync. crbug.com/305024. | 21 // TODO(stevenjb): Integrate with Sync. crbug.com/305024. |
20 class AppListSyncableService : public BrowserContextKeyedService { | 22 class AppListSyncableService : public BrowserContextKeyedService, |
| 23 public content::NotificationObserver { |
21 public: | 24 public: |
22 explicit AppListSyncableService(Profile* profile); | 25 explicit AppListSyncableService(Profile* profile); |
23 virtual ~AppListSyncableService(); | 26 virtual ~AppListSyncableService(); |
24 | 27 |
25 AppListModel* model() { return model_.get(); } | 28 AppListModel* model() { return model_.get(); } |
26 | 29 |
27 private: | 30 private: |
| 31 void BuildModel(); |
| 32 |
| 33 // content::NotificationObserver: |
| 34 virtual void Observe(int type, |
| 35 const content::NotificationSource& source, |
| 36 const content::NotificationDetails& details) OVERRIDE; |
| 37 |
28 Profile* profile_; | 38 Profile* profile_; |
| 39 content::NotificationRegistrar registrar_; |
29 scoped_ptr<AppListModel> model_; | 40 scoped_ptr<AppListModel> model_; |
30 scoped_ptr<ExtensionAppModelBuilder> apps_builder_; | 41 scoped_ptr<ExtensionAppModelBuilder> apps_builder_; |
31 | 42 |
32 DISALLOW_COPY_AND_ASSIGN(AppListSyncableService); | 43 DISALLOW_COPY_AND_ASSIGN(AppListSyncableService); |
33 }; | 44 }; |
34 | 45 |
35 } // namespace app_list | 46 } // namespace app_list |
36 | 47 |
37 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SYNCABLE_SERVICE_H_ | 48 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SYNCABLE_SERVICE_H_ |
OLD | NEW |