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

Side by Side Diff: chrome/browser/extensions/extension_assets_manager.h

Issue 273193006: Install Chrome OS apps to shared location (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added uninstall Created 6 years, 7 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
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
23 // thread.
24 class ExtensionAssetsManager {
25 public:
26 // Callback that is invoked when the extension assets 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;
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);
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);
46
47 protected:
48 ExtensionAssetsManager() {}
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698