1 // Copyright (c) 2014 Intel Corporation. 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 XWALK_APPLICATION_COMMON_INSTALLER_PACKAGE_INSTALLER_H_
6 #define XWALK_APPLICATION_COMMON_INSTALLER_PACKAGE_INSTALLER_H_
9 #include "base/files/file_path.h"
10 #include "base/memory/scoped_ptr.h"
13 namespace application {
15 class ApplicationData;
16 class ApplicationStorage;
18 class PackageInstaller {
20 static scoped_ptr<PackageInstaller> Create(ApplicationStorage* storage);
22 virtual ~PackageInstaller();
24 bool Install(const base::FilePath& path, std::string* id);
25 bool Uninstall(const std::string& id);
26 bool Update(const std::string& id, const base::FilePath& path);
27 void ContinueUnfinishedTasks();
29 virtual void SetQuiet(bool quiet);
30 virtual void SetInstallationKey(const std::string& key);
33 explicit PackageInstaller(ApplicationStorage* storage);
35 virtual std::string PrepareUninstallationID(const std::string& id);
37 // Those to be overriden to implement platform specific logic.
38 virtual bool PlatformInstall(ApplicationData* data);
39 virtual bool PlatformUninstall(ApplicationData* data);
40 virtual bool PlatformUpdate(ApplicationData* updated_data);
42 ApplicationStorage* storage_;
45 } // namespace application
48 #endif // XWALK_APPLICATION_COMMON_INSTALLER_PACKAGE_INSTALLER_H_