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_
10 #include "base/files/file_path.h"
11 #include "base/memory/scoped_ptr.h"
14 namespace application {
16 class ApplicationData;
17 class ApplicationStorage;
19 } // namespace application
22 class PlatformInstaller;
24 class PackageInstaller {
26 static scoped_ptr<PackageInstaller> Create(
27 xwalk::application::ApplicationStorage* storage);
31 bool Install(const base::FilePath& path, std::string* id);
32 bool Uninstall(const std::string& id);
33 bool Update(const std::string& id, const base::FilePath& path);
34 bool Reinstall(const base::FilePath& path);
36 void ContinueUnfinishedTasks();
38 void SetQuiet(bool quiet);
39 void SetInstallationKey(const std::string& key);
42 explicit PackageInstaller(xwalk::application::ApplicationStorage* storage);
44 std::string PrepareUninstallationID(const std::string& id);
46 bool PlatformInstall(xwalk::application::ApplicationData* data);
47 bool PlatformUninstall(const std::string& app_id);
48 bool PlatformUpdate(xwalk::application::ApplicationData* updated_data);
49 bool PlatformReinstall(const base::FilePath& path);
51 xwalk::application::ApplicationStorage* storage_;
56 void InitializePkgmgrSignal(PlatformInstaller* platform_installer,
57 const std::string& action, const std::string& action_arg);
60 #endif // XWALK_APPLICATION_TOOLS_TIZEN_XWALK_PACKAGE_INSTALLER_H_