Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / extensions / extension_assets_manager.h
blobced7d3eca62cf7d0a312a2fb72a2160467da0308
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.
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_ASSETS_MANAGER_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ASSETS_MANAGER_H_
8 #include <string>
10 #include "base/callback.h"
11 #include "base/files/file_path.h"
13 class Profile;
15 namespace extensions {
17 class Extension;
19 // Assets manager for installed extensions. Some extensions can be installed in
20 // a shared place for multiple profiles (users). This class manages install and
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 the extension file task
23 // runner thread.
24 class ExtensionAssetsManager {
25 public:
26 // Callback that is invoked when the extension assets are installed.
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;
31 static ExtensionAssetsManager* GetInstance();
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;
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;
47 protected:
48 virtual ~ExtensionAssetsManager() {}
51 } // namespace extensions
53 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ASSETS_MANAGER_H_