using xwalk::application::ApplicationData;
using xwalk::application::ApplicationStorage;
using xwalk::application::FileDeleter;
+using xwalk::application::Manifest;
using xwalk::application::Package;
namespace {
std::string icon_name;
if (!app_data->GetManifest()->GetString(
- GetIcon128Key(app_data->GetPackageType()), &icon_name))
+ GetIcon128Key(app_data->manifest_type()), &icon_name))
LOG(WARNING) << "'icon' not included in manifest";
// This will clean everything inside '<data dir>/<app id>'.
std::string icon_name;
if (!app_data->GetManifest()->GetString(
- GetIcon128Key(app_data->GetPackageType()), &icon_name))
+ GetIcon128Key(app_data->manifest_type()), &icon_name))
LOG(WARNING) << "'icon' not included in manifest";
// This will clean everything inside '<data dir>/<app id>' and the new XML.
std::string error;
scoped_refptr<ApplicationData> app_data = LoadApplication(
unpacked_dir, app_id, ApplicationData::LOCAL_DIRECTORY,
- package->type(), &error);
+ package->manifest_type(), &error);
if (!app_data) {
LOG(ERROR) << "Error during application installation: " << error;
return false;
return false;
}
- app_data->SetPath(app_dir);
+ app_data->set_path(app_dir);
if (!storage_->AddApplication(app_data)) {
LOG(ERROR) << "Application with id " << app_data->ID()
std::string error;
scoped_refptr<ApplicationData> new_app_data =
- LoadApplication(unpacked_dir,
- app_id,
- ApplicationData::TEMP_DIRECTORY,
- package->type(),
- &error);
+ LoadApplication(unpacked_dir, app_id, ApplicationData::TEMP_DIRECTORY,
+ package->manifest_type(), &error);
if (!new_app_data) {
LOG(ERROR) << "An error occurred during application updating: " << error;
return false;
return false;
}
- if (
- // For Tizen WGT package, downgrade to a lower version or reinstall
- // is permitted when using Tizen WRT, Crosswalk runtime need to follow
- // this behavior on Tizen platform.
- package->type() != Package::WGT &&
+ // For Tizen WGT package, downgrade to a lower version or reinstall
+ // is permitted when using Tizen WRT, Crosswalk runtime need to follow
+ // this behavior on Tizen platform.
+ if (package->manifest_type() != Manifest::TYPE_WIDGET &&
old_app_data->Version()->CompareTo(
*(new_app_data->Version())) >= 0) {
LOG(INFO) << "The version number of new XPK/WGT package "
return false;
}
- const base::FilePath& app_dir = old_app_data->Path();
+ const base::FilePath& app_dir = old_app_data->path();
const base::FilePath tmp_dir(app_dir.value()
+ FILE_PATH_LITERAL(".tmp"));
!base::Move(unpacked_dir, app_dir))
return false;
- new_app_data = LoadApplication(app_dir,
- app_id,
- ApplicationData::LOCAL_DIRECTORY,
- package->type(),
- &error);
+ new_app_data = LoadApplication(
+ app_dir, app_id, ApplicationData::LOCAL_DIRECTORY,
+ package->manifest_type(), &error);
if (!new_app_data) {
LOG(ERROR) << "Error during loading new package: " << error;
base::DeleteFile(app_dir, true);