OLD | NEW |
| (Empty) |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef ATHENA_EXTENSIONS_PUBLIC_EXTENSION_APP_MODEL_BUILDER_H_ | |
6 #define ATHENA_EXTENSIONS_PUBLIC_EXTENSION_APP_MODEL_BUILDER_H_ | |
7 | |
8 #include "athena/home/public/app_model_builder.h" | |
9 #include "base/macros.h" | |
10 #include "base/memory/ref_counted.h" | |
11 #include "extensions/browser/extension_registry_observer.h" | |
12 | |
13 namespace content { | |
14 class BrowserContext; | |
15 } | |
16 | |
17 namespace extensions { | |
18 class Extension; | |
19 } | |
20 | |
21 namespace athena { | |
22 | |
23 class ATHENA_EXPORT ExtensionAppModelBuilder | |
24 : public AppModelBuilder, | |
25 public extensions::ExtensionRegistryObserver { | |
26 public: | |
27 explicit ExtensionAppModelBuilder(content::BrowserContext* browser_context); | |
28 ~ExtensionAppModelBuilder() override; | |
29 | |
30 void RegisterAppListModel(app_list::AppListModel* model) override; | |
31 | |
32 private: | |
33 void AddItem(scoped_refptr<const extensions::Extension> extension); | |
34 | |
35 // extensions::ExtensionRegistryObserver: | |
36 void OnExtensionInstalled(content::BrowserContext* browser_context, | |
37 const extensions::Extension* extension, | |
38 bool is_update) override; | |
39 void OnExtensionUninstalled(content::BrowserContext* browser_context, | |
40 const extensions::Extension* extension, | |
41 extensions::UninstallReason reason) override; | |
42 | |
43 content::BrowserContext* browser_context_; | |
44 | |
45 // Unowned pointer to the app list model. | |
46 app_list::AppListModel* model_; | |
47 | |
48 DISALLOW_COPY_AND_ASSIGN(ExtensionAppModelBuilder); | |
49 }; | |
50 | |
51 } // namespace athena | |
52 | |
53 #endif // ATHENA_EXTENSIONS_PUBLIC_EXTENSION_APP_MODEL_BUILDER_H_ | |
OLD | NEW |