OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 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 CHROME_BROWSER_EXTENSIONS_EXTENSION_ASSETS_MANAGER_H_ | |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ASSETS_MANAGER_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/callback.h" | |
11 #include "base/files/file_path.h" | |
12 | |
13 class Profile; | |
14 | |
15 namespace extensions { | |
16 | |
17 class Extension; | |
18 | |
19 // Assets manager for installed extensions. Some extensions can be installed in | |
20 // shared place for multiple profiles (users). This class manages install and | |
asargent_no_longer_on_chrome
2014/05/20 21:20:25
nit: "in shared place" -> "in a shared place"
Dmitry Polukhin
2014/05/20 23:42:16
Done.
| |
21 // uninstall. At the time being shared location is used for default apps on | |
22 // Chrome OS only. This class must be used only from extension file task runner | |
asargent_no_longer_on_chrome
2014/05/20 21:20:25
nit: "only from extension file task runner" -> "on
Dmitry Polukhin
2014/05/20 23:42:16
Done.
| |
23 // thread. | |
24 class ExtensionAssetsManager { | |
25 public: | |
26 // Callback that is invoked when the extension assets installed. | |
asargent_no_longer_on_chrome
2014/05/20 21:20:25
nit: "when the extension assets installed" -> "whe
Dmitry Polukhin
2014/05/20 23:42:16
Done.
| |
27 // |file_path| is destination directory on success or empty in case of error. | |
28 typedef base::Callback<void(const base::FilePath& file_path)> | |
29 InstallExtensionCallback; | |
30 | |
31 static ExtensionAssetsManager* GetInstance(); | |
32 | |
33 // Copy extension assets to final location. This location could be under | |
34 // |local_install_dir| or some common location shared for multiple users. | |
35 virtual void InstallExtension(const Extension* extension, | |
36 const base::FilePath& unpacked_extension_root, | |
37 const base::FilePath& local_install_dir, | |
38 Profile* profile, | |
39 InstallExtensionCallback callback) = 0; | |
40 | |
41 // Remove extension assets if it is not used by anyone else. | |
42 virtual void UninstallExtension(const std::string& id, | |
43 Profile* profile, | |
44 const base::FilePath& local_install_dir, | |
45 const base::FilePath& extension_root) = 0; | |
46 | |
47 protected: | |
48 ExtensionAssetsManager() {} | |
asargent_no_longer_on_chrome
2014/05/20 21:20:25
Do you need this constructor?
Dmitry Polukhin
2014/05/20 23:42:16
Done.
| |
49 virtual ~ExtensionAssetsManager() {} | |
50 | |
51 DISALLOW_COPY_AND_ASSIGN(ExtensionAssetsManager); | |
52 }; | |
53 | |
54 } // namespace extensions | |
55 | |
56 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ASSETS_MANAGER_H_ | |
OLD | NEW |