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

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

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 #include "chrome/browser/extensions/extension_assets_manager.h"
6
7 #include "extensions/common/extension.h"
8 #include "extensions/common/file_util.h"
9
10 #if defined(OS_CHROMEOS)
11 #include "chrome/browser/extensions/extension_assets_manager_chromeos.h"
12 #endif
13
14 namespace extensions {
15
16 // static
17 ExtensionAssetsManager* ExtensionAssetsManager::GetInstance() {
18 #if defined(OS_CHROMEOS)
19 return ExtensionAssetsManagerChromeOS::GetInstance();
20 #else
21 // If not Chrome OS, use trivial implementation that doesn't share anything.
22 static ExtensionAssetsManager manager;
23 return &manager;
24 #endif // OS_CHROMEOS
25 }
26
27 void ExtensionAssetsManager::InstallExtension(
28 const Extension* extension,
29 const base::FilePath& unpacked_extension_root,
30 const base::FilePath& local_install_dir,
31 Profile* profile,
32 InstallExtensionCallback callback) {
33 callback.Run(file_util::InstallExtension(
34 unpacked_extension_root,
35 extension->id(),
36 extension->VersionString(),
37 local_install_dir));
38 }
39
40 void ExtensionAssetsManager::UninstallExtension(
41 const std::string& id,
42 Profile* profile,
43 const base::FilePath& local_install_dir,
44 const base::FilePath& extension_root) {
45 DCHECK(local_install_dir.IsParent(extension_root));
46 file_util::UninstallExtension(local_install_dir, id);
47 }
48
49 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698