1 // Copyright (c) 2014 Intel Corporation. All rights reserved.
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
6 #ifndef XWALK_APPLICATION_TOOLS_TIZEN_XWALK_PACKAGE_INSTALLER_H_
7 #define XWALK_APPLICATION_TOOLS_TIZEN_XWALK_PACKAGE_INSTALLER_H_
11 #include "base/files/file_path.h"
12 #include "base/memory/scoped_ptr.h"
15 namespace application {
17 class ApplicationData;
18 class ApplicationStorage;
20 } // namespace application
23 class PlatformInstaller;
25 class PackageInstaller {
27 static scoped_ptr<PackageInstaller> Create(
28 xwalk::application::ApplicationStorage* storage);
32 bool Install(const base::FilePath& path, std::string* id);
33 bool Uninstall(const std::string& id);
34 bool Update(const std::string& id, const base::FilePath& path);
35 bool Reinstall(const std::string& pkgid);
37 void ContinueUnfinishedTasks();
39 void SetQuiet(bool quiet);
40 void SetInstallationKey(const std::string& key);
43 explicit PackageInstaller(xwalk::application::ApplicationStorage* storage);
45 std::string PrepareUninstallationID(const std::string& id);
47 bool PlatformInstall(xwalk::application::ApplicationData* data);
48 bool PlatformUninstall(const std::string& app_id);
49 bool PlatformUpdate(xwalk::application::ApplicationData* updated_data);
50 bool PlatformReinstall(const std::string& pkgid);
52 xwalk::application::ApplicationStorage* storage_;
57 void InitializePkgmgrSignal(PlatformInstaller* platform_installer,
58 const std::string& action, const std::string& action_arg);
61 #endif // XWALK_APPLICATION_TOOLS_TIZEN_XWALK_PACKAGE_INSTALLER_H_