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_TOOLS_TIZEN_XWALK_PACKAGE_INSTALLER_H_
6 #define XWALK_APPLICATION_TOOLS_TIZEN_XWALK_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 } // namespace application
21 class PackageInstaller {
23 static scoped_ptr<PackageInstaller> Create(
24 xwalk::application::ApplicationStorage* storage);
28 bool Install(const base::FilePath& path, std::string* id);
29 bool Uninstall(const std::string& id);
30 bool Update(const std::string& id, const base::FilePath& path);
31 bool Reinstall(const base::FilePath& path);
33 void ContinueUnfinishedTasks();
35 void SetQuiet(bool quiet);
36 void SetInstallationKey(const std::string& key);
39 explicit PackageInstaller(xwalk::application::ApplicationStorage* storage);
41 std::string PrepareUninstallationID(const std::string& id);
43 bool PlatformInstall(xwalk::application::ApplicationData* data);
44 bool PlatformUninstall(const std::string& app_id);
45 bool PlatformUpdate(xwalk::application::ApplicationData* updated_data);
46 bool PlatformReinstall(const base::FilePath& path);
48 xwalk::application::ApplicationStorage* storage_;
55 #endif // XWALK_APPLICATION_TOOLS_TIZEN_XWALK_PACKAGE_INSTALLER_H_