1 // Copyright (c) 2013 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_BROWSER_INSTALLER_TIZEN_PACKAGE_INSTALLER_H_
6 #define XWALK_APPLICATION_BROWSER_INSTALLER_TIZEN_PACKAGE_INSTALLER_H_
10 #include "base/files/file_path.h"
11 #include "xwalk/application/browser/application_service.h"
14 namespace application {
16 class ApplicationStorage;
18 // Utility class to interact with Tizen package manager. For installation, it
19 // takes an app_id already installed to Crosswalk application store, generate
20 // the necessary resources (e.g. icon for home screen) and add a new entry to
21 // Tizen database. Uninstallation will remove the created resources and remove
22 // the entry from Tizen database.
23 class PackageInstaller {
26 static scoped_ptr<PackageInstaller> Create(
27 ApplicationService* service,
28 ApplicationStorage* storage,
29 const std::string& package_id,
30 const base::FilePath& data_dir);
36 ApplicationService* service,
37 ApplicationStorage* storage,
38 const std::string& package_id,
39 const base::FilePath& data_dir);
41 bool GeneratePkgInfoXml();
42 bool CopyOrLinkResources();
43 bool WriteToPackageInfoDB();
44 bool ChangeOwnerRecursive(
45 const base::FilePath& path,
49 const ApplicationService* service_;
50 const ApplicationStorage* storage_;
51 scoped_refptr<const ApplicationData> application_;
52 std::string package_id_;
53 std::string icon_name_;
54 std::string stripped_name_;
55 base::FilePath data_dir_;
56 base::FilePath app_dir_;
57 base::FilePath xml_path_;
58 base::FilePath execute_path_;
59 base::FilePath icon_path_;
61 DISALLOW_COPY_AND_ASSIGN(PackageInstaller);
64 } // namespace application
67 #endif // XWALK_APPLICATION_BROWSER_INSTALLER_TIZEN_PACKAGE_INSTALLER_H_