| Index: chrome/browser/extensions/extension_assets_manager.cc
|
| diff --git a/chrome/browser/extensions/extension_assets_manager.cc b/chrome/browser/extensions/extension_assets_manager.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..0fbf68188d47db466a74a699bf0eb4610d0f1a30
|
| --- /dev/null
|
| +++ b/chrome/browser/extensions/extension_assets_manager.cc
|
| @@ -0,0 +1,49 @@
|
| +// Copyright (c) 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "chrome/browser/extensions/extension_assets_manager.h"
|
| +
|
| +#include "extensions/common/extension.h"
|
| +#include "extensions/common/file_util.h"
|
| +
|
| +#if defined(OS_CHROMEOS)
|
| +#include "chrome/browser/extensions/extension_assets_manager_chromeos.h"
|
| +#endif
|
| +
|
| +namespace extensions {
|
| +
|
| +// static
|
| +ExtensionAssetsManager* ExtensionAssetsManager::GetInstance() {
|
| +#if defined(OS_CHROMEOS)
|
| + return ExtensionAssetsManagerChromeOS::GetInstance();
|
| +#else
|
| + // If not Chrome OS, use trivial implementation that doesn't share anything.
|
| + static ExtensionAssetsManager manager;
|
| + return &manager;
|
| +#endif // OS_CHROMEOS
|
| +}
|
| +
|
| +void ExtensionAssetsManager::InstallExtension(
|
| + const Extension* extension,
|
| + const base::FilePath& unpacked_extension_root,
|
| + const base::FilePath& local_install_dir,
|
| + Profile* profile,
|
| + InstallExtensionCallback callback) {
|
| + callback.Run(file_util::InstallExtension(
|
| + unpacked_extension_root,
|
| + extension->id(),
|
| + extension->VersionString(),
|
| + local_install_dir));
|
| +}
|
| +
|
| +void ExtensionAssetsManager::UninstallExtension(
|
| + const std::string& id,
|
| + Profile* profile,
|
| + const base::FilePath& local_install_dir,
|
| + const base::FilePath& extension_root) {
|
| + DCHECK(local_install_dir.IsParent(extension_root));
|
| + file_util::UninstallExtension(local_install_dir, id);
|
| +}
|
| +
|
| +} // namespace extensions
|
|
|